瀏覽代碼

关于界面

詹子聪 6 年之前
父節點
當前提交
4ada4bfc8a

+ 2 - 3
app/src/main/java/com/itant/shibei/ui/TabActivity.java

@@ -27,7 +27,6 @@ import com.itant.shibei.ui.home.about.upgrade.UpgradePresenter;
 import com.itant.shibei.ui.home.coupon.TemplateFragment;
 import com.itant.shibei.ui.home.goods.GoodsFragment;
 import com.itant.shibei.ui.home.search.SearchActivity;
-import com.itant.shibei.ui.home.tool.ToolFragment;
 import com.itant.shibei.ui.mine.MineActivity;
 import com.itant.shibei.ui.mine.login.LoginActivity;
 import com.itant.shibei.widget.AppbarTranslateListener;
@@ -59,12 +58,12 @@ public class TabActivity extends BaseBeiActivity implements View.OnClickListener
 
     @Override
     public void initViews(Bundle savedInstanceState) {
-        String[] titles = {"推荐", "好券", "工具", "关于"};
+        String[] titles = {"推荐", "图片", "关于"};
         List<Fragment> fragments = new ArrayList<>();
         fragments.add(new GoodsFragment());
         fragments.add(new TemplateFragment(FunctionFragment.TEMPLATE_TYPE_BONUS));
         //fragments.add(new TemplateFragment(FunctionFragment.TEMPLATE_TYPE_TEMPLATE));
-        fragments.add(new ToolFragment());
+        //fragments.add(new ToolFragment());
         fragments.add(new AboutFragment());
 
         ViewPager vp_main = findViewById(R.id.vp_main);

+ 20 - 1
app/src/main/java/com/itant/shibei/ui/home/about/AboutFragment.java

@@ -25,17 +25,31 @@ import com.miekir.mvp.view.BaseMVPFragment;
  */
 public class AboutFragment extends BaseMVPFragment implements View.OnClickListener, ICommonView<UpgradeBean> {
 
+    private static final String TITLE_FORMAT = "伊甸园 v%s%s";
+
     @InjectPresenter
     UpgradePresenter upgradePresenter;
 
     @Override
     protected void onViewInit() {
         TextView tv_title = rootView.findViewById(R.id.tv_title);
-        tv_title.setText(" 拾贝 v" + SystemTool.getVersionName(getActivity()));
+        TextView tv_desc = rootView.findViewById(R.id.tv_desc);
+        TextView tv_active = rootView.findViewById(R.id.tv_active);
+        // todo 判断是否已激活
+        boolean isActive = false;
+        String title = String.format(TITLE_FORMAT, SystemTool.getVersionName(getActivity()), isActive ? "(已激活)" : "(未激活)");
+        tv_title.setText(title);
+
+        if (isActive) {
+            tv_desc.setVisibility(View.GONE);
+            tv_active.setVisibility(View.GONE);
+        }
+
         rootView.findViewById(R.id.tv_feedback).setOnClickListener(this);
         rootView.findViewById(R.id.tv_update).setOnClickListener(this);
         rootView.findViewById(R.id.tv_more).setOnClickListener(this);
         rootView.findViewById(R.id.tv_protocol).setOnClickListener(this);
+        rootView.findViewById(R.id.tv_active).setOnClickListener(this);
     }
 
     @Override
@@ -60,10 +74,15 @@ public class AboutFragment extends BaseMVPFragment implements View.OnClickListen
                 upgradePresenter.getUpgradeInfo();
                 break;
 
+            case R.id.tv_active:
+                // todo 立即激活
+                break;
+
             case R.id.tv_more:
                 SystemTool.copyText(getActivity(), "http://jianjie.life");
                 ToastTool.showShort("已拷贝主页链接");
                 break;
+
             case R.id.tv_protocol:
                 ActivityTool.openUrl(getActivity(), "http://note.youdao.com/s/KTiCW1qH");
                 break;

+ 22 - 5
app/src/main/res/layout/fragment_about.xml

@@ -29,13 +29,13 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:src="@drawable/ic_launcher"
-            android:tint="@color/black_theme" />
+            android:tint="@color/black_theme"
+            android:visibility="gone"/>
 
         <TextView
             android:id="@+id/tv_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/margin_ss"
             android:text="拾贝"
             android:textColor="@color/black_theme"
             android:textSize="@dimen/text_normal_p"
@@ -51,11 +51,12 @@
         android:textColor="@color/black_droid_text"
         android:textSize="@dimen/text_normal" />-->
     <TextView
+        android:id="@+id/tv_desc"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:paddingStart="@dimen/margin_default"
         android:paddingEnd="@dimen/margin_default"
-        android:text="&#12288;&#12288;每一件在拾贝上展示的商品,都是开发者购买并体验之后精心挑选的。\n&#12288;&#12288;拾贝收集了各大平台的优惠券,并提供丰富的购物模板,让用户花更少的钱,买到更好的产品。\n&#12288;&#12288;另外面向开发者上线了一些实用的小工具,如GetJson接口服务,每个用户都可以拥有一个属于自己的URL,GET请求该URL则返回保存在服务端的JSON数据。"
+        android:text="点击下方的“立即激活”进行转账,备注当前账号的邮箱(非常重要),退出应用稍等片刻重新打开APP,即可完成激活。一定要在备注填写需要激活的账号对应的邮箱,否则无法完成激活。"
         android:textColor="@color/black_droid_text"
         android:textSize="@dimen/text_normal" />
 
@@ -70,6 +71,20 @@
         android:textColor="@color/green_logo"
         android:textSize="@dimen/text_normal_s"
         android:textStyle="bold"
+        android:background="?attr/selectableItemBackground"
+        android:visibility="gone"/>
+
+    <TextView
+        android:id="@+id/tv_active"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/margin_default"
+        android:layout_marginStart="@dimen/margin_default"
+        android:layout_marginEnd="@dimen/margin_default"
+        android:text="立即激活"
+        android:textColor="@color/green_logo"
+        android:textSize="@dimen/text_normal_s"
+        android:textStyle="bold"
         android:background="?attr/selectableItemBackground"/>
 
     <TextView
@@ -96,7 +111,8 @@
         android:textColor="@color/green_logo"
         android:textSize="@dimen/text_normal_s"
         android:textStyle="bold"
-        android:background="?attr/selectableItemBackground"/>
+        android:background="?attr/selectableItemBackground"
+        android:visibility="gone"/>
 
     <Space
         android:layout_width="wrap_content"
@@ -114,6 +130,7 @@
         android:gravity="center"
         android:text="隐私权限 · 服务条款"
         android:textColor="@color/black_title"
-        android:textSize="@dimen/text_s" />
+        android:textSize="@dimen/text_s"
+        android:visibility="gone"/>
     <include layout="@layout/view_divider" />
 </LinearLayout>