feat: 初始化界面
2
.idea/misc.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
@ -20,19 +20,14 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// compileOptions {
|
||||||
compileOptions {
|
// sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
// targetCompatibility JavaVersion.VERSION_1_8
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
// }
|
||||||
|
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dependencies {
|
||||||
dependencies {
|
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||||
@ -42,14 +37,9 @@ android {
|
|||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||||
//butterknife依赖
|
// //butterknife依赖
|
||||||
implementation 'com.jakewharton:butterknife:10.2.1'
|
// implementation 'com.jakewharton:butterknife:10.1.0'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
|
// annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
|
||||||
//状态栏侵染
|
|
||||||
|
|
||||||
// 基础依赖包,必须要依赖
|
|
||||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
|
||||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
|
||||||
|
|
||||||
|
|
||||||
//网络框架
|
//网络框架
|
||||||
@ -69,4 +59,9 @@ android {
|
|||||||
|
|
||||||
//加载图片的依赖包
|
//加载图片的依赖包
|
||||||
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
||||||
|
//状态栏侵染
|
||||||
|
|
||||||
|
// 基础依赖包,必须要依赖
|
||||||
|
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||||
|
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||||
}
|
}
|
@ -8,16 +8,20 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme">
|
||||||
<activity android:name=".activity.HomeActivity"></activity>
|
|
||||||
<activity android:name=".activity.MainActivity">
|
<activity android:name=".activity.MainActivity">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".activity.HomeActivity">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".activity.LoginActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".activity.LoginActivity"></activity>
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -1,107 +1,22 @@
|
|||||||
package com.example.myapplication.activity;
|
package com.example.myapplication.activity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TableLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.fragment.app.FragmentPagerAdapter;
|
|
||||||
|
|
||||||
import com.example.myapplication.base.BaseActivity;
|
import com.example.myapplication.base.BaseActivity;
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.example.myapplication.fragment.FindFragment;
|
|
||||||
import com.example.myapplication.fragment.MineFragment;
|
|
||||||
import com.example.myapplication.fragment.RecordFragment;
|
|
||||||
import com.example.myapplication.fragment.TreasureFragment;
|
|
||||||
import com.example.myapplication.util.NoSlideViewPager;
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
public class HomeActivity extends BaseActivity{
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建首页布局展示
|
|
||||||
*/
|
|
||||||
public class HomeActivity extends BaseActivity {
|
|
||||||
private NoSlideViewPager mViewPager;
|
|
||||||
private TabLayout mTab;
|
|
||||||
private final String[] name = {"寻宝", "记录", "发现", "我的"};
|
|
||||||
private final int[] pic = {R.mipmap.map_select,R.mipmap.task_select,R.mipmap.article_select,R.mipmap.mine_select};
|
|
||||||
private final int[] pic1 = {R.mipmap.map,R.mipmap.task,R.mipmap.article,R.mipmap.mine};
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.activity_home;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initView() {
|
|
||||||
super.initView();
|
|
||||||
ImmersionBar.with(this)
|
|
||||||
.statusBarDarkFont(true, 0.2f)
|
|
||||||
//原理:如果当前设备支持状态栏字体变色,会设置状态栏字体为黑色,如果当前设备不支持状态栏字体变色,会使当前状态栏加上透明度,否则不执行透明度
|
|
||||||
.init();
|
|
||||||
mTab=findViewById(R.id.tab_layout);
|
|
||||||
mViewPager=findViewById(R.id.no_slide_view_pager);
|
|
||||||
ArrayList<Fragment> fragments = new ArrayList<>();
|
|
||||||
fragments.add(new TreasureFragment());
|
|
||||||
fragments.add(new RecordFragment());
|
|
||||||
fragments.add(new FindFragment());
|
|
||||||
fragments.add(new MineFragment());
|
|
||||||
|
|
||||||
mViewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
|
|
||||||
@Override
|
|
||||||
public Fragment getItem(int i) {
|
|
||||||
return fragments.get(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount() {
|
|
||||||
return fragments.size();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mTab.setupWithViewPager(mViewPager);
|
|
||||||
mTab.getTabAt(0).setText(name[0]).setIcon(pic[0]);
|
|
||||||
mTab.getTabAt(1).setText(name[1]).setIcon(pic1[1]);
|
|
||||||
mTab.getTabAt(2).setText(name[2]).setIcon(pic1[2]);
|
|
||||||
mTab.getTabAt(3).setText(name[3]).setIcon(pic1[3]);
|
|
||||||
mTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
|
||||||
//禁止table layout效果
|
|
||||||
@Override
|
|
||||||
public void onTabSelected(TabLayout.Tab tab) {
|
|
||||||
mTab.getTabAt(tab.getPosition()).setIcon(pic[tab.getPosition()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//点击table layout效果
|
|
||||||
@Override
|
|
||||||
public void onTabUnselected(TabLayout.Tab tab) {
|
|
||||||
mTab.getTabAt(tab.getPosition()).setIcon(pic1[tab.getPosition()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabReselected(TabLayout.Tab tab) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
public View getTabView(String name,int image) {
|
|
||||||
View view = LayoutInflater.from(this).inflate(R.layout.item_tab, null);
|
|
||||||
TextView txt_title = (TextView) view.findViewById(R.id.txt_title);
|
|
||||||
txt_title.setText(name);
|
|
||||||
ImageView img_title = (ImageView) view.findViewById(R.id.img_title);
|
|
||||||
img_title.setImageResource(image);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void initData() {
|
|
||||||
super.initData();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ import com.example.myapplication.base.BaseActivity;
|
|||||||
public class LoginActivity extends BaseActivity {
|
public class LoginActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.login_activity;
|
return R.layout.activity_login;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,21 +2,11 @@ package com.example.myapplication.activity;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CountDownTimer;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.Window;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
|
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.example.myapplication.base.BaseActivity;
|
import com.example.myapplication.base.BaseActivity;
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动页
|
|
||||||
*/
|
|
||||||
public class MainActivity extends BaseActivity {
|
public class MainActivity extends BaseActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -27,19 +17,6 @@ public class MainActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData();
|
super.initData();
|
||||||
new CountDownTimer(3000, 1000) {
|
|
||||||
@Override
|
|
||||||
public void onTick(long l) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinish() {
|
|
||||||
Intent intent = new Intent(MainActivity.this, HomeActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -5,9 +5,6 @@ import android.graphics.drawable.ColorDrawable;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
|
||||||
@ -15,16 +12,15 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.example.myapplication.R;
|
|
||||||
import com.example.myapplication.api.UserApplication;
|
import com.example.myapplication.api.UserApplication;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import butterknife.Unbinder;
|
|
||||||
|
|
||||||
public abstract class BaseActivity extends AppCompatActivity {
|
public abstract class BaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private Unbinder bind;
|
|
||||||
private AlertDialog alertDialog;
|
private AlertDialog alertDialog;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -35,7 +31,6 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
ImmersionBar.with(this).init();
|
ImmersionBar.with(this).init();
|
||||||
Collector.addActivity(this);
|
Collector.addActivity(this);
|
||||||
setContentView(getLayout());
|
setContentView(getLayout());
|
||||||
bind = ButterKnife.bind(this);
|
|
||||||
initMVP();
|
initMVP();
|
||||||
initView();
|
initView();
|
||||||
initData();
|
initData();
|
||||||
@ -47,14 +42,14 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
protected void initMVP() {
|
protected void initMVP() {
|
||||||
}
|
}
|
||||||
public void showLoadingDialog() {
|
public void showLoadingDialog() {
|
||||||
alertDialog = new AlertDialog.Builder(this).create();
|
// alertDialog = new AlertDialog.Builder(this).create();
|
||||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
// alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||||
alertDialog.setCancelable(false);
|
// alertDialog.setCancelable(false);
|
||||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
// alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
// if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||||
return true;
|
// return true;
|
||||||
return false;
|
// return false;
|
||||||
});
|
// });
|
||||||
//loading样式
|
//loading样式
|
||||||
//View view = LayoutInflater.from(this).inflate(R.layout.loading_alert, null);
|
//View view = LayoutInflater.from(this).inflate(R.layout.loading_alert, null);
|
||||||
//alertDialog.setView(view);
|
//alertDialog.setView(view);
|
||||||
@ -91,7 +86,6 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
Collector.removeActivity(this);
|
Collector.removeActivity(this);
|
||||||
bind.unbind();
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 设置屏幕横竖屏切换
|
* 设置屏幕横竖屏切换
|
||||||
|
@ -13,19 +13,18 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import butterknife.Unbinder;
|
|
||||||
|
|
||||||
public abstract class BaseFragment extends Fragment {
|
public abstract class BaseFragment extends Fragment {
|
||||||
|
|
||||||
private Unbinder bind;
|
|
||||||
private AlertDialog alertDialog;
|
private AlertDialog alertDialog;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
View inflate = inflater.inflate(getLayout(), container, false);
|
View inflate = inflater.inflate(getLayout(), container, false);
|
||||||
bind = ButterKnife.bind(this, inflate);
|
|
||||||
initMvp();
|
initMvp();
|
||||||
initView();
|
initView();
|
||||||
initData();
|
initData();
|
||||||
@ -38,19 +37,20 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
|
|
||||||
protected abstract int getLayout();
|
protected abstract int getLayout();
|
||||||
public void showLoadingDialog() {
|
public void showLoadingDialog() {
|
||||||
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
// alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
// alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||||
alertDialog.setCancelable(false);
|
// alertDialog.setCancelable(false);
|
||||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
// alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
// if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||||
return true;
|
// return true;
|
||||||
return false;
|
// return false;
|
||||||
});
|
//
|
||||||
|
// });
|
||||||
//loading样式
|
//loading样式
|
||||||
//View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
|
//View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
|
||||||
//alertDialog.setView(view);
|
//alertDialog.setView(view);
|
||||||
alertDialog.setCanceledOnTouchOutside(false);
|
// alertDialog.setCanceledOnTouchOutside(false);
|
||||||
alertDialog.show();
|
// alertDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoadingDialogText(String s) {
|
public void setLoadingDialogText(String s) {
|
||||||
@ -75,6 +75,6 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
bind.unbind();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,23 @@
|
|||||||
package com.example.myapplication.fragment;
|
package com.example.myapplication.fragment;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.example.myapplication.R;
|
import com.example.myapplication.R;
|
||||||
import com.example.myapplication.base.BaseFragment;
|
import com.example.myapplication.base.BaseFragment;
|
||||||
|
|
||||||
|
|
||||||
|
import presenter.CapacityEvaluationPresenter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发现的Fragment
|
* 发现的Fragment
|
||||||
* 2021-5-25
|
* 2021-5-25
|
||||||
*/
|
*/
|
||||||
public class FindFragment extends BaseFragment {
|
public class FindFragment extends BaseFragment {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.find_fragment;
|
return R.layout.find_fragment;
|
||||||
@ -22,4 +32,7 @@ public class FindFragment extends BaseFragment {
|
|||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData();
|
super.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
7
app/src/main/java/model/CapacityEvaluationModel.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package model;
|
||||||
|
|
||||||
|
import com.example.myapplication.base.BaseModel;
|
||||||
|
|
||||||
|
public class CapacityEvaluationModel extends BaseModel {
|
||||||
|
|
||||||
|
}
|
12
app/src/main/java/presenter/CapacityEvaluationPresenter.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package presenter;
|
||||||
|
|
||||||
|
import com.example.myapplication.base.BasePresenter;
|
||||||
|
|
||||||
|
import model.CapacityEvaluationModel;
|
||||||
|
|
||||||
|
public class CapacityEvaluationPresenter extends BasePresenter {
|
||||||
|
@Override
|
||||||
|
protected void initModel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
7
app/src/main/res/drawable/text_color.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<size android:width="3dp" android:height="6dp"/>
|
||||||
|
<solid android:color="@color/colorBack" />
|
||||||
|
|
||||||
|
</shape>
|
5
app/src/main/res/drawable/tv_explain.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke android:width="1dp" android:color="@color/colorGrey"/>
|
||||||
|
<solid android:color="@color/colorWhite"/>
|
||||||
|
</shape>
|
@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".activity.HomeActivity">
|
tools:context="activity.HomeActivity">
|
||||||
|
|
||||||
<com.example.myapplication.util.NoSlideViewPager
|
<com.example.myapplication.util.NoSlideViewPager
|
||||||
android:id="@+id/no_slide_view_pager"
|
android:id="@+id/no_slide_view_pager"
|
||||||
|
119
app/src/main/res/layout/activity_login.xml
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@mipmap/bg"
|
||||||
|
tools:context="activity.LoginActivity">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="35dp"
|
||||||
|
android:layout_marginTop="70dp"
|
||||||
|
android:text="Welcome"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="30sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_login_deck"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="35dp"
|
||||||
|
android:text="欢迎来到地图寻宝"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="35sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/login_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:text="用户名"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/tv_login_deck"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_login_deck" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_login_name"
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:hint="编码/手机号/邮箱"
|
||||||
|
android:paddingBottom="20dp"
|
||||||
|
android:textColorHint="@color/colorTransparent"
|
||||||
|
android:textCursorDrawable="@drawable/text_color"
|
||||||
|
android:theme="@style/MyEditText"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/login_name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/login_name" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/login_paw"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:text="密码"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/et_login_name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/et_login_name" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_login_paw"
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:hint="请输入密码"
|
||||||
|
android:paddingBottom="15dp"
|
||||||
|
android:textColorHint="@color/colorTransparent"
|
||||||
|
android:textCursorDrawable="@drawable/text_color"
|
||||||
|
android:theme="@style/MyEditText"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/login_paw"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/login_paw" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/cb_disclaimer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:buttonTint="@color/colorWhite"
|
||||||
|
android:text="免责声明"
|
||||||
|
android:scaleX="0.7"
|
||||||
|
android:scaleY="0.7"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/et_login_paw"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/et_login_paw" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_register"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:text="注册"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/tv_forget_paw"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/et_login_paw"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_forget_paw"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="忘记密码"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/et_login_paw"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/et_login_paw" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -5,7 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/ic_launcher_background"
|
android:background="@drawable/ic_launcher_background"
|
||||||
tools:context=".activity.MainActivity">
|
tools:context="activity.MainActivity">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_view"
|
android:id="@+id/tv_view"
|
||||||
|
@ -6,11 +6,46 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_announcement"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="发现的Fragment"
|
android:text="最新公告"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:textSize="16dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:textColor="@color/colorBack"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_margin="10dp"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_help_center"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:text="帮助中心"
|
||||||
|
android:textSize="16dp"
|
||||||
|
android:background="@color/colorWhite"
|
||||||
|
android:textColor="@color/colorBack"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:paddingLeft="20dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_announcement"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_task_explain"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:text="任务说明"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/tv_explain"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_help_center"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_capacity_evaluation"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:text="能力测评"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/tv_explain"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_help_center"
|
||||||
|
app:layout_constraintLeft_toRightOf="@+id/tv_task_explain"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 600 B |
28
app/src/main/res/navigation/nav_graph.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<navigation 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"
|
||||||
|
android:id="@+id/nav_graph"
|
||||||
|
app:startDestination="@id/FirstFragment">
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/FirstFragment"
|
||||||
|
android:name="com.example.myapplication.activity.FirstFragment"
|
||||||
|
android:label="@string/first_fragment_label"
|
||||||
|
tools:layout="@layout/fragment_first">
|
||||||
|
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_FirstFragment_to_SecondFragment"
|
||||||
|
app:destination="@id/SecondFragment" />
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/SecondFragment"
|
||||||
|
android:name="com.example.myapplication.activity.SecondFragment"
|
||||||
|
android:label="@string/second_fragment_label"
|
||||||
|
tools:layout="@layout/fragment_second">
|
||||||
|
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_SecondFragment_to_FirstFragment"
|
||||||
|
app:destination="@id/FirstFragment" />
|
||||||
|
</fragment>
|
||||||
|
</navigation>
|
@ -3,4 +3,8 @@
|
|||||||
<color name="colorPrimary">#6200EE</color>
|
<color name="colorPrimary">#6200EE</color>
|
||||||
<color name="colorPrimaryDark">#3700B3</color>
|
<color name="colorPrimaryDark">#3700B3</color>
|
||||||
<color name="colorAccent">#03DAC5</color>
|
<color name="colorAccent">#03DAC5</color>
|
||||||
|
<color name="colorBack">#000000</color>
|
||||||
|
<color name="colorGrey">#FAFAFA</color>
|
||||||
|
<color name="colorWhite">#ffffff</color>
|
||||||
|
<color name="colorTransparent">#7fffffff</color>
|
||||||
</resources>
|
</resources>
|
@ -1,6 +1,6 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
@ -15,5 +15,20 @@
|
|||||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||||
|
<!-- <style name="MyEditText" parent="Theme.AppCompat.Light">–>-->
|
||||||
|
<!-- <item name="colorControlNormal">@color/colorWhite</item>-->
|
||||||
|
<!-- </style>-->
|
||||||
|
<!-- 设置Editext下划线颜色-->
|
||||||
|
<style name="MyEditText" parent="Theme.AppCompat.Light">
|
||||||
|
<item name="colorControlNormal">@android:color/darker_gray</item>
|
||||||
|
<item name="colorControlActivated">@android:color/darker_gray</item>
|
||||||
|
</style>
|
||||||
|
<!-- 设置Checkbox边框大小-->
|
||||||
|
<!-- <style-->
|
||||||
|
<!-- name="MyCheckBox"-->
|
||||||
|
<!-- parent="@android:style/Widget.CompoundButton.CheckBox">-->
|
||||||
|
<!-- <item name="android:button">-->
|
||||||
|
<!-- -->
|
||||||
|
<!-- </item>-->
|
||||||
|
<!-- </style>-->
|
||||||
</resources>
|
</resources>
|
@ -15,5 +15,9 @@ org.gradle.jvmargs=-Xmx2048m
|
|||||||
# Android operating system, and which are packaged with your app"s APK
|
# Android operating system, and which are packaged with your app"s APK
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
systemProp.http.proxyHost=127.0.0.1
|
||||||
|
systemProp.http.proxyPort=1080
|
||||||
|
systemProp.https.proxyHost=127.0.0.1
|
||||||
|
systemProp.https.proxyPort=1080
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|