解决冲突
2
.idea/misc.xml
generated
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@ -20,19 +20,14 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
// compileOptions {
|
||||
// sourceCompatibility JavaVersion.VERSION_1_8
|
||||
// targetCompatibility JavaVersion.VERSION_1_8
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
dependencies {
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
@ -50,6 +45,7 @@ android {
|
||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||
|
||||
|
||||
|
||||
//网络框架
|
||||
implementation 'com.lzy.net:okgo:3.0.4'
|
||||
implementation 'com.google.code.gson:gson:2.8.5'
|
||||
@ -70,4 +66,5 @@ android {
|
||||
|
||||
//xRecyclerview下拉刷新控件
|
||||
implementation project(':xrecyclerview')
|
||||
|
||||
}
|
@ -11,9 +11,7 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
>
|
||||
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<activity android:name=".activity.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@ -21,9 +19,12 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activity.LoginActivity"></activity>
|
||||
<activity android:name=".activity.HomeActivity"></activity>
|
||||
<activity android:name=".activity.HomeActivity">
|
||||
</activity>
|
||||
<activity android:name=".activity.LoginActivity">
|
||||
</activity>
|
||||
<activity android:name=".activity.ManagementFragment"></activity>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -1,34 +1,33 @@
|
||||
package com.example.myapplication.activity;
|
||||
|
||||
|
||||
|
||||
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 android.os.Bundle;
|
||||
|
||||
import com.example.myapplication.base.BaseActivity;
|
||||
|
||||
|
||||
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.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.myapplication.R;
|
||||
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 = {"寻宝", "记录", "发现", "我的"};
|
||||
@ -102,9 +101,4 @@ public class HomeActivity extends BaseActivity {
|
||||
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 {
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.login_activity;
|
||||
return R.layout.activity_login;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,17 +4,10 @@ package com.example.myapplication.activity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
|
||||
import android.os.CountDownTimer;
|
||||
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.base.BaseActivity;
|
||||
|
||||
/**
|
||||
* 启动页
|
||||
*/
|
||||
public class MainActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
@ -25,19 +18,6 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void 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();
|
||||
|
||||
}
|
||||
private void initPermission() {
|
||||
String[] pers = {
|
||||
|
@ -44,10 +44,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||
alertDialog.setCancelable(false);
|
||||
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 false;
|
||||
});
|
||||
});
|
||||
//loading样式
|
||||
//View view = LayoutInflater.from(this).inflate(R.layout.loading_alert, null);
|
||||
//alertDialog.setView(view);
|
||||
@ -96,4 +96,5 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,10 +40,11 @@ public abstract class BaseFragment extends Fragment {
|
||||
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
});
|
||||
//loading样式
|
||||
//View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
|
||||
@ -74,5 +75,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,16 @@ import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
|
||||
import com.example.myapplication.R;
|
||||
import com.example.myapplication.activity.ManagementFragment;
|
||||
import com.example.myapplication.base.BaseFragment;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
|
||||
|
||||
import presenter.CapacityEvaluationPresenter;
|
||||
|
||||
|
||||
/**
|
||||
* 发现的Fragment
|
||||
* 2021-5-25
|
||||
|
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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.HomeActivity">
|
||||
tools:context="activity.HomeActivity">
|
||||
|
||||
<com.example.myapplication.util.NoSlideViewPager
|
||||
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_height="match_parent"
|
||||
android:background="@drawable/ic_launcher_background"
|
||||
tools:context=".activity.MainActivity">
|
||||
tools:context="activity.MainActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_view"
|
||||
|
@ -177,4 +177,6 @@
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</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: 6.7 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 425 B |
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 |
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="colorPrimaryDark">#3700B3</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>
|
@ -1,6 +1,6 @@
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
@ -15,5 +15,20 @@
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<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>
|
@ -15,5 +15,9 @@ org.gradle.jvmargs=-Xmx2048m
|
||||
# Android operating system, and which are packaged with your app"s APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
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
|
||||
android.enableJetifier=true
|