Browse Source

bug修复

dxh 5 years ago
parent
commit
01459b6b48

+ 8 - 0
app/src/main/java/com/electric/chargingpile/fragment/TalkRecommendFragment.java

@ -5,6 +5,7 @@ import android.os.Bundle;
5 5
import android.support.v4.app.Fragment;
6 6
import android.support.v7.widget.RecyclerView;
7 7
import android.support.v7.widget.StaggeredGridLayoutManager;
8
import android.text.TextUtils;
8 9
import android.util.Log;
9 10
import android.view.LayoutInflater;
10 11
import android.view.View;
@ -24,6 +25,7 @@ import com.electric.chargingpile.application.MainApplication;
24 25
import com.electric.chargingpile.data.Person;
25 26
import com.electric.chargingpile.data.TalkRecommendBean;
26 27
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
28
import com.electric.chargingpile.manager.ProfileManager;
27 29
import com.electric.chargingpile.util.JsonUtils;
28 30
import com.electric.chargingpile.util.NetUtil;
29 31
import com.electric.chargingpile.util.ToastUtil;
@ -62,6 +64,12 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
62 64
        view = inflater.inflate(R.layout.activity_talk_recommend_tj, null);
63 65
        initXRefreshView();
64 66
67
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
68
        if(TextUtils.isEmpty(isFirstComeIn)){
69
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
70
            view.findViewById(R.id.share_info_icon).setVisibility(View.VISIBLE);
71
        }
72
65 73
        initData();
66 74
        layoutAdapter = new LayoutAdapter(getActivity());
67 75
        // 设置静默加载模式

+ 11 - 0
app/src/main/java/com/electric/chargingpile/manager/ProfileManager.java

@ -59,6 +59,7 @@ public class ProfileManager {
59 59
    private static final String KEY_APP_OPERATOR = "key_app_operator";
60 60
    private static final String KEY_DATA_UPTIME = "key_data_uptime";
61 61
    private static final String KEY_FIND_DATE = "key_find_date";
62
    private static final String KEY_ADD_COME_FIRST = "key_add_come_first";
62 63

63 64
    private static ProfileManager instance;
64 65

@ -180,6 +181,11 @@ public class ProfileManager {
180 181
                .putString(KEY_USERNAME, username);
181 182
    }
182 183

184
    public void setFirstComeIn(Context context, String content) {
185
        PreferenceManager.getInstance(context)
186
                .putString(KEY_ADD_COME_FIRST, content);
187
    }
188

183 189
    public void setPreviousUser(Context context, String previous) {
184 190
        PreferenceManager.getInstance(context)
185 191
                .putString(KEY_PREVIOUS_USER, previous);
@ -488,6 +494,11 @@ public class ProfileManager {
488 494
                "");
489 495
    }
490 496

497
    public String getIsFirstComeIn(Context context) {
498
        return PreferenceManager.getInstance(context).getString(KEY_ADD_COME_FIRST,
499
                "");
500
    }
501

491 502
    public void setYuyue(Context context, String password) {
492 503
        PreferenceManager.getInstance(context).putString(KEY_YUYUE, password);
493 504
    }

+ 31 - 0
app/src/main/res/layout/activity_talk_recommend_tj.xml

@ -26,4 +26,35 @@
26 26
        android:layout_marginBottom="22dp"
27 27
        android:src="@drawable/app_share_talk_icon"/>
28 28
29
    <LinearLayout
30
        android:id="@+id/share_info_icon"
31
        android:layout_width="wrap_content"
32
        android:layout_height="56dp"
33
        android:layout_toLeftOf="@+id/iv_ask"
34
        android:layout_alignParentBottom="true"
35
        android:layout_marginBottom="22dp"
36
        android:orientation="horizontal"
37
        android:gravity="center_vertical"
38
        android:visibility="gone">
39
40
        <TextView
41
            android:layout_width="wrap_content"
42
            android:layout_height="match_parent"
43
            android:text="分享内容获电币"
44
            android:background="@drawable/bg_yuan_black"
45
            android:paddingLeft="10dp"
46
            android:paddingRight="10dp"
47
            android:gravity="center"
48
            android:textColor="@color/white"
49
            android:textSize="12sp"
50
            />
51
52
        <ImageView
53
            android:layout_width="15dp"
54
            android:layout_height="15dp"
55
            android:layout_marginLeft="-5dp"
56
            android:src="@drawable/app_sanjiao_right"/>
57
58
    </LinearLayout>
59
29 60
</RelativeLayout>