Bladeren bron

升级VIP的界面

詹子聪 5 jaren geleden
bovenliggende
commit
c0894237b2

+ 11 - 2
app/src/main/java/com/itant/shibei/ui/mine/MineActivity.java

@@ -12,6 +12,7 @@ import android.widget.Switch;
 import androidx.annotation.Nullable;
 import androidx.appcompat.app.AlertDialog;
 
+import com.google.android.material.textfield.TextInputEditText;
 import com.itant.shibei.R;
 import com.itant.shibei.base.BaseBeiActivity;
 import com.itant.shibei.bean.BeiUser;
@@ -35,6 +36,7 @@ public class MineActivity extends BaseBeiActivity implements View.OnClickListene
     // 当前金额
     private Switch switch_api;
     private Switch switch_walk;
+    private TextInputEditText et_email;
 
     private BeiUser mUser;
 
@@ -48,7 +50,7 @@ public class MineActivity extends BaseBeiActivity implements View.OnClickListene
         mUser = UserInfoManager.getInstance().getBeiUser();
         setTitle(String.format(ConstantString.WELCOME_HELLO, TimeTool.getCurrentTimePeriod(), mUser.nickName));
         ViewTool.setOnClickListener(this, this,
-                new int[]{R.id.tv_my_fav, R.id.btn_exit_login, R.id.tv_add_photo, R.id.tv_deal_vip});
+                new int[]{R.id.tv_my_fav, R.id.btn_exit_login, R.id.tv_add_photo, R.id.btn_set_vip});
 
         // 只有我才能管理后台
         View ll_admin = findViewById(R.id.ll_admin);
@@ -58,6 +60,7 @@ public class MineActivity extends BaseBeiActivity implements View.OnClickListene
             ll_admin.setVisibility(View.GONE);
         }
 
+        et_email = findViewById(R.id.et_email);
         switch_api = findViewById(R.id.switch_api);
         switch_walk = findViewById(R.id.switch_api);
         switch_api.setOnCheckedChangeListener(this);
@@ -83,8 +86,14 @@ public class MineActivity extends BaseBeiActivity implements View.OnClickListene
                 startActivity(new Intent(this, MyFavActivity.class));
                 break;
 
-            case R.id.tv_deal_vip:
+            case R.id.btn_set_vip:
                 // todo 设置会员VIP
+                String email = et_email.getEditableText().toString();
+                if (TextUtils.isEmpty(email)) {
+                    ToastTool.showShort("账号不能为空");
+                    return;
+                }
+
                 break;
 
             case R.id.tv_add_photo:

+ 40 - 9
app/src/main/res/layout/activity_mine.xml

@@ -2,6 +2,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:fillViewport="true"
     android:fitsSystemWindows="true"
     android:orientation="vertical"
@@ -29,16 +30,46 @@
         android:layout_height="wrap_content"
         android:orientation="vertical">
 
-        <TextView
-            android:id="@+id/tv_deal_vip"
+        <com.google.android.material.textfield.TextInputLayout
             android:layout_width="match_parent"
-            android:layout_height="@dimen/height_tab_bar"
-            android:background="?attr/selectableItemBackground"
-            android:gravity="center_vertical"
-            android:paddingStart="@dimen/activity_horizontal_margin"
-            android:paddingEnd="@dimen/activity_horizontal_margin"
-            android:text="让用户成为VIP"
-            android:textColor="@color/black_text" />
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/margin_default"
+            android:layout_marginEnd="@dimen/margin_default"
+            android:layout_marginTop="@dimen/margin_default"
+            android:hint="请输入要升级的账号"
+            app:boxBackgroundMode="outline"
+            app:boxCornerRadiusBottomEnd="4dp"
+            app:boxCornerRadiusBottomStart="4dp"
+            app:boxCornerRadiusTopEnd="4dp"
+            app:boxCornerRadiusTopStart="4dp"
+            app:boxStrokeWidth="@dimen/width_stroke"
+            app:boxStrokeWidthFocused="@dimen/width_stroke"
+            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
+
+            <com.google.android.material.textfield.TextInputEditText
+                android:id="@+id/et_email"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textSize="@dimen/text_normal_s"
+                android:inputType="textEmailAddress"
+                android:maxLength="50"/>
+        </com.google.android.material.textfield.TextInputLayout>
+
+        <android.widget.Button
+            android:id="@+id/btn_set_vip"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:minHeight="0dp"
+            android:layout_margin="@dimen/margin_default"
+            android:paddingTop="@dimen/padding_full_width"
+            android:paddingBottom="@dimen/padding_full_width"
+            android:text="升级为VIP用户"
+            android:textColor="@color/white"
+            android:textStyle="bold"
+            android:background="@drawable/selector_btn"
+            style="?android:attr/borderlessButtonStyle"/>
+
+
 
         <include layout="@layout/view_divider_common"/>