version:1.0.0
bugfixes: update:增加登录
This commit is contained in:
@@ -29,6 +29,10 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".activity.login.LoginActivity"
|
||||||
|
android:launchMode="singleTask" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.category.CategoryActivity"
|
android:name=".activity.category.CategoryActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.view.View;
|
|||||||
|
|
||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
import androidx.recyclerview.widget.DefaultItemAnimator;
|
import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import com.hainaos.vc.R;
|
import com.hainaos.vc.R;
|
||||||
import com.hainaos.vc.adapter.VideoAdapter;
|
import com.hainaos.vc.adapter.VideoAdapter;
|
||||||
@@ -24,6 +25,7 @@ public class CategoryActivity extends BaseMvvmActivity<CategoryViewModel, Activi
|
|||||||
|
|
||||||
private static final String TAG = "CategoryActivity";
|
private static final String TAG = "CategoryActivity";
|
||||||
private String mTitle;
|
private String mTitle;
|
||||||
|
private String mDirName;
|
||||||
|
|
||||||
private VideoAdapter mVideoAdapter;
|
private VideoAdapter mVideoAdapter;
|
||||||
|
|
||||||
@@ -60,12 +62,21 @@ public class CategoryActivity extends BaseMvvmActivity<CategoryViewModel, Activi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
mViewDataBinding.rvVideo.setAdapter(mVideoAdapter);
|
mViewDataBinding.rvVideo.setAdapter(mVideoAdapter);
|
||||||
|
|
||||||
|
mViewDataBinding.swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
mViewDataBinding.swipeRefreshLayout.setRefreshing(true);
|
||||||
|
mViewModel.getViedoList(mDirName);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mTitle = intent.getStringExtra("title");
|
mTitle = intent.getStringExtra("title");
|
||||||
|
mDirName = intent.getStringExtra("dir");
|
||||||
mViewDataBinding.setTitle(mTitle);
|
mViewDataBinding.setTitle(mTitle);
|
||||||
|
|
||||||
|
|
||||||
@@ -73,9 +84,10 @@ public class CategoryActivity extends BaseMvvmActivity<CategoryViewModel, Activi
|
|||||||
@Override
|
@Override
|
||||||
public void onChanged(ArrayList<LocalVideoInfo> localVideoInfos) {
|
public void onChanged(ArrayList<LocalVideoInfo> localVideoInfos) {
|
||||||
mVideoAdapter.setData(localVideoInfos);
|
mVideoAdapter.setData(localVideoInfos);
|
||||||
|
mViewDataBinding.swipeRefreshLayout.setRefreshing(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mViewModel.getViedoList();
|
mViewModel.getViedoList(mDirName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,27 @@
|
|||||||
package com.hainaos.vc.activity.category;
|
package com.hainaos.vc.activity.category;
|
||||||
|
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
||||||
import com.hainaos.vc.bean.LocalVideoInfo;
|
import com.hainaos.vc.bean.LocalVideoInfo;
|
||||||
import com.hainaos.vc.databinding.ActivityCategoryBinding;
|
import com.hainaos.vc.databinding.ActivityCategoryBinding;
|
||||||
|
import com.hainaos.vc.utils.VideoUtils;
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class CategoryViewModel extends BaseViewModel<ActivityCategoryBinding, ActivityEvent> {
|
public class CategoryViewModel extends BaseViewModel<ActivityCategoryBinding, ActivityEvent> {
|
||||||
|
|
||||||
|
private static final String TAG = "CategoryViewModel";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActivityCategoryBinding getVDBinding() {
|
public ActivityCategoryBinding getVDBinding() {
|
||||||
return binding;
|
return binding;
|
||||||
@@ -23,22 +34,28 @@ public class CategoryViewModel extends BaseViewModel<ActivityCategoryBinding, Ac
|
|||||||
|
|
||||||
public MutableLiveData<ArrayList<LocalVideoInfo>> mLocalVideoInfosData = new MutableLiveData<>();
|
public MutableLiveData<ArrayList<LocalVideoInfo>> mLocalVideoInfosData = new MutableLiveData<>();
|
||||||
|
|
||||||
public void getViedoList() {
|
public void getViedoList(String dir) {
|
||||||
|
File file = new File(Environment.getExternalStorageDirectory() + File.separator + "haina" + File.separator + dir);
|
||||||
|
if (file.exists()) {
|
||||||
|
String[] strings = file.list();
|
||||||
|
Log.e(TAG, "getViedoList: " + Arrays.toString(strings));
|
||||||
|
if (strings != null) {
|
||||||
|
List<String> paths = new ArrayList<>(Arrays.asList(strings));
|
||||||
|
ArrayList<LocalVideoInfo> localVideoInfos = paths.stream().map(new Function<String, LocalVideoInfo>() {
|
||||||
|
@Override
|
||||||
|
public LocalVideoInfo apply(String s) {
|
||||||
LocalVideoInfo localVideoInfo = new LocalVideoInfo();
|
LocalVideoInfo localVideoInfo = new LocalVideoInfo();
|
||||||
localVideoInfo.setFile_name("test_video_1");
|
localVideoInfo.setFile_name(VideoUtils.getFileNameWithoutExtension(s));
|
||||||
localVideoInfo.setLocalPath("/storage/emulated/0/Movies/test_video_1.mp4");
|
localVideoInfo.setLocalPath(new File(file.getAbsolutePath() + File.separator + s).getAbsolutePath());
|
||||||
ArrayList<LocalVideoInfo> localVideoInfos = new ArrayList<>();
|
return localVideoInfo;
|
||||||
localVideoInfos.add(localVideoInfo);
|
}
|
||||||
localVideoInfos.add(localVideoInfo);
|
}).collect(Collectors.toCollection(ArrayList::new));
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
localVideoInfos.add(localVideoInfo);
|
|
||||||
|
|
||||||
mLocalVideoInfosData.setValue(localVideoInfos);
|
mLocalVideoInfosData.setValue(localVideoInfos);
|
||||||
|
} else {
|
||||||
|
mLocalVideoInfosData.setValue(null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mLocalVideoInfosData.setValue(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.hainaos.vc.activity.login;
|
||||||
|
|
||||||
|
import com.hainaos.vc.R;
|
||||||
|
import com.hainaos.vc.base.mvvm.BaseMvvmActivity;
|
||||||
|
import com.hainaos.vc.databinding.ActivityLoginBinding;
|
||||||
|
|
||||||
|
public class LoginActivity extends BaseMvvmActivity<LoginViewModel, ActivityLoginBinding> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_login;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initDataBinding() {
|
||||||
|
mViewModel.setCtx(this);
|
||||||
|
mViewModel.setVDBinding(mViewDataBinding);
|
||||||
|
mViewModel.setLifecycle(getLifecycleSubject());
|
||||||
|
mViewDataBinding.setClick(new BtnClick());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BtnClick {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.hainaos.vc.activity.login;
|
||||||
|
|
||||||
|
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
||||||
|
import com.hainaos.vc.databinding.ActivityLoginBinding;
|
||||||
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
|
||||||
|
public class LoginViewModel extends BaseViewModel<ActivityLoginBinding, ActivityEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActivityLoginBinding getVDBinding() {
|
||||||
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ import androidx.core.app.ActivityCompat;
|
|||||||
|
|
||||||
import com.hainaos.vc.R;
|
import com.hainaos.vc.R;
|
||||||
import com.hainaos.vc.activity.category.CategoryActivity;
|
import com.hainaos.vc.activity.category.CategoryActivity;
|
||||||
|
import com.hainaos.vc.activity.login.LoginActivity;
|
||||||
import com.hainaos.vc.base.mvvm.BaseMvvmActivity;
|
import com.hainaos.vc.base.mvvm.BaseMvvmActivity;
|
||||||
import com.hainaos.vc.config.CommonConfig;
|
import com.hainaos.vc.config.CommonConfig;
|
||||||
import com.hainaos.vc.databinding.ActivityMainBinding;
|
import com.hainaos.vc.databinding.ActivityMainBinding;
|
||||||
@@ -316,9 +317,10 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openCategory(String title) {
|
private void openCategory(String title, String dir) {
|
||||||
Intent intent = new Intent(MainActivity.this, CategoryActivity.class);
|
Intent intent = new Intent(MainActivity.this, CategoryActivity.class);
|
||||||
intent.putExtra("title", title);
|
intent.putExtra("title", title);
|
||||||
|
intent.putExtra("dir", dir);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,44 +329,48 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
|||||||
lazyExit();
|
lazyExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void login(View view) {
|
||||||
|
startActivity(new Intent(MainActivity.this, LoginActivity.class));
|
||||||
|
}
|
||||||
|
|
||||||
public void open1(View view) {
|
public void open1(View view) {
|
||||||
openCategory("发型设计");
|
openCategory("发型设计", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open2(View view) {
|
public void open2(View view) {
|
||||||
openCategory("化妆基础");
|
openCategory("化妆基础", "2");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open3(View view) {
|
public void open3(View view) {
|
||||||
openCategory("美甲技巧");
|
openCategory("美甲技巧", "3");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open4(View view) {
|
public void open4(View view) {
|
||||||
openCategory("皮肤管理");
|
openCategory("皮肤管理", "4");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open5(View view) {
|
public void open5(View view) {
|
||||||
openCategory("纹绣入门");
|
openCategory("纹绣入门", "5");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open6(View view) {
|
public void open6(View view) {
|
||||||
openCategory("美睫教程");
|
openCategory("美睫教程", "6");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open7(View view) {
|
public void open7(View view) {
|
||||||
openCategory("形象穿搭");
|
openCategory("形象穿搭", "7");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open8(View view) {
|
public void open8(View view) {
|
||||||
openCategory("门店营销");
|
openCategory("门店营销", "8");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open9(View view) {
|
public void open9(View view) {
|
||||||
openCategory("色彩搭配");
|
openCategory("色彩搭配", "9");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open10(View view) {
|
public void open10(View view) {
|
||||||
openCategory("工具消毒");
|
openCategory("工具消毒", "10");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open11(View view) {
|
public void open11(View view) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder>
|
|||||||
File file = new File(localPath);
|
File file = new File(localPath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
holder.iv_status.setVisibility(View.GONE);
|
holder.iv_status.setVisibility(View.GONE);
|
||||||
Glide.with(mContext).load(url + "?x-oss-process=video/snapshot,t_0,f_jpg").error(R.mipmap.ic_launcher).into(holder.video_image);
|
Glide.with(mContext).load(file).error(R.mipmap.ic_launcher).into(holder.video_image);
|
||||||
holder.duration.setText(TimeUtils.TimeFormat(localVideoInfo.getDuration() * 1000));
|
holder.duration.setText(TimeUtils.TimeFormat(localVideoInfo.getDuration() * 1000));
|
||||||
// Observable.create(new ObservableOnSubscribe<VideoResult>() {
|
// Observable.create(new ObservableOnSubscribe<VideoResult>() {
|
||||||
// @Override
|
// @Override
|
||||||
@@ -166,7 +166,7 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder>
|
|||||||
if (JgyUtils.getInstance().fileExists(url)) {
|
if (JgyUtils.getInstance().fileExists(url)) {
|
||||||
Intent intent = new Intent(mContext, TikTokActivity.class);
|
Intent intent = new Intent(mContext, TikTokActivity.class);
|
||||||
intent.putExtra("position", position);
|
intent.putExtra("position", position);
|
||||||
intent.putParcelableArrayListExtra("list", mLocalVideoInfos);
|
intent.putExtra("list", mLocalVideoInfos);
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
JgyUtils.getInstance().ariaDownload(url, GsonUtils.getJsonObject(GsonUtils.toJSONString(localVideoInfo)));
|
JgyUtils.getInstance().ariaDownload(url, GsonUtils.getJsonObject(GsonUtils.toJSONString(localVideoInfo)));
|
||||||
|
|||||||
7
app/src/main/res/drawable/bg_login.xml
Normal file
7
app/src/main/res/drawable/bg_login.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="#9C9C9C"
|
||||||
|
android:startColor="#9B8085" />
|
||||||
|
</shape>
|
||||||
9
app/src/main/res/drawable/bg_login_button.xml
Normal file
9
app/src/main/res/drawable/bg_login_button.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#D05171" />
|
||||||
|
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
10
app/src/main/res/drawable/edit_background.xml
Normal file
10
app/src/main/res/drawable/edit_background.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#EEEEEE" />
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
@@ -53,8 +53,8 @@
|
|||||||
android:id="@+id/tv_title"
|
android:id="@+id/tv_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/white"
|
|
||||||
android:text="@{title}"
|
android:text="@{title}"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -71,11 +71,17 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/cl_title">
|
app:layout_constraintTop_toBottomOf="@+id/cl_title">
|
||||||
|
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/swipeRefreshLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_video"
|
android:id="@+id/rv_video"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
127
app/src/main/res/layout/activity_login.xml
Normal file
127
app/src/main/res/layout/activity_login.xml
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".activity.login.LoginActivity">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.hainaos.vc.activity.login.LoginActivity.BtnClick" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_login">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
|
android:background="@drawable/background_add"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="账号登录"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_mobile"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/edit_background"
|
||||||
|
android:hint="请输入手机号码"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:paddingStart="4dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="#848484"
|
||||||
|
android:textSize="11sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_passwd"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/edit_background"
|
||||||
|
android:hint="请输入手机号码"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:paddingStart="4dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="#848484"
|
||||||
|
android:textSize="11sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/bg_login_button"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="登录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@@ -77,6 +77,7 @@
|
|||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
|
android:onClick="@{click::login}"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/icon_main_login"
|
android:src="@drawable/icon_main_login"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
Reference in New Issue
Block a user