endian11
2019-06-05 05015fe5917ef89f7adc650230dc431eb03b1043
驾考app界面加入背景;新建module library
11个文件已修改
9个文件已添加
202 ■■■■■ 已修改文件
app/src/main/java/safeluck/drive/evaluation/adapter/ScoreAdapter.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/app.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/bean/ScoreBean.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/HomeFragment.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/PasswordFragment.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/util/Utils.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/layout_base_set.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/layout_check_signal.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/layout_pwd_fragment.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/layout_signal_config.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/values/styles.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/build.gradle 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/proguard-rules.pro 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/androidTest/java/com/anyun/exam/lib/ExampleInstrumentedTest.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/AndroidManifest.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/java/com/anyun/exam/lib/AYSdk.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/java/com/anyun/exam/lib/RemoteService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/main/res/values/strings.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/src/test/java/com/anyun/exam/lib/ExampleUnitTest.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/adapter/ScoreAdapter.java
@@ -79,10 +79,10 @@
        }
        ScoreBean scoreBean = getItem(position);
        dataHodler.tv_item.setTextColor(Color.parseColor("#0e0cca"));
        dataHodler.tv_item.setText(scoreBean.getmItem());
        dataHodler.tv_item.setText(scoreBean.getItem());
        dataHodler.tv_score.setTextColor(Color.parseColor("#0e0cca"));
        dataHodler.tv_score.setText(String.valueOf(scoreBean.getmScore()));
        dataHodler.tv_score.setText(String.valueOf(scoreBean.getScore()));
        dataHodler.tv_reason.setTextColor(Color.parseColor("#0e0cca"));
        dataHodler.tv_reason.setText(scoreBean.getReason());
        return convertView;
app/src/main/java/safeluck/drive/evaluation/app.java
@@ -20,7 +20,7 @@
    public void onCreate() {
        super.onCreate();
        //初始化Fragment 建议在Application onCreate里面初始化
        Fragmentation.builder().stackViewMode(Fragmentation.BUBBLE).debug(BuildConfig.DEBUG)
        Fragmentation.builder().stackViewMode(Fragmentation.BUBBLE).debug(false)
                .handleException(new ExceptionHandler() {
                    @Override
                    public void onException(@NonNull Exception e) {
app/src/main/java/safeluck/drive/evaluation/bean/ScoreBean.java
@@ -21,19 +21,19 @@
        this.reason = reason;
    }
    public float getmScore() {
    public float getScore() {
        return mScore;
    }
    public void setmScore(float mScore) {
    public void setScore(float mScore) {
        this.mScore = mScore;
    }
    public String getmItem() {
    public String getItem() {
        return mItem;
    }
    public void setmItem(String mItem) {
    public void setItem(String mItem) {
        this.mItem = mItem;
    }
app/src/main/java/safeluck/drive/evaluation/fragment/HomeFragment.java
@@ -44,6 +44,9 @@
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
@@ -84,16 +87,15 @@
                break;
            case R.id.system_setting:
                SupportFragment pwdFragment = findFragment(PasswordFragment.class);
                if (pwdFragment == null) {
                    pwdFragment = PasswordFragment.newInstance();
                    extraTransaction().startDontHideSelf(pwdFragment);
                //打开输入密码界面
                PasswordFragment passwordFragment = findFragment(PasswordFragment.class);
                if (passwordFragment == null) {
                    passwordFragment = (PasswordFragment) PasswordFragment.newInstance();
                    start(passwordFragment);
                } else {
                    extraTransaction().startDontHideSelf(pwdFragment);
                    start(passwordFragment);
                }
//                    extraTransaction().startDontHideSelf(PasswordFragment.newInstance());
                break;
        }
    }
app/src/main/java/safeluck/drive/evaluation/fragment/PasswordFragment.java
@@ -29,10 +29,8 @@
    public static SupportFragment newInstance() {
        Bundle args = new Bundle();
        PasswordFragment fragment = new PasswordFragment();
        fragment.setArguments(args);
        return fragment;
    }
@@ -57,7 +55,7 @@
        switch (v.getId()) {
            case R.id.btn_cancle:
               pop();
          pop();
                break;
            case R.id.btn_sure:
                String pwd = editText.getText().toString().trim();
app/src/main/java/safeluck/drive/evaluation/util/Utils.java
@@ -13,4 +13,13 @@
    public static float px2dp(float value){
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,value, Resources.getSystem().getDisplayMetrics());
    }
    /**
     * dp值转像素
     * @param dpValue
     * @return
     */
    public static float dp2Px(int dpValue){
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,dpValue,Resources.getSystem().getDisplayMetrics());
    }
}
app/src/main/res/layout/layout_base_set.xml
@@ -30,6 +30,7 @@
    <android.support.v4.view.ViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/train_bg"
        android:id="@+id/vp_base_set">
    </android.support.v4.view.ViewPager>
app/src/main/res/layout/layout_check_signal.xml
@@ -3,7 +3,7 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
        android:background="@android:color/white"
    >
    <include layout="@layout/toolbar"/>
    <FrameLayout
app/src/main/res/layout/layout_pwd_fragment.xml
@@ -17,6 +17,7 @@
    android:layout_width="match_parent"
    app:counterMaxLength="8"
    app:counterEnabled="true"
    app:passwordToggleEnabled="true"
    android:id="@+id/txt_input_1"
    android:layout_height="60dp">
<EditText
app/src/main/res/layout/layout_signal_config.xml
@@ -3,6 +3,7 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@android:color/white"
    android:id="@+id/ll_container"
    >
    <include layout="@layout/toolbar"/>
app/src/main/res/values/styles.xml
@@ -5,6 +5,7 @@
        <!-- Customize your theme here. -->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowBackground">@null</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="colorPrimary">@color/colorPrimary</item>
lib/.gitignore
New file
@@ -0,0 +1 @@
/build
lib/build.gradle
New file
@@ -0,0 +1,33 @@
apply plugin: 'com.android.library'
android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
lib/proguard-rules.pro
New file
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
lib/src/androidTest/java/com/anyun/exam/lib/ExampleInstrumentedTest.java
New file
@@ -0,0 +1,26 @@
package com.anyun.exam.lib;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();
        assertEquals("com.anyun.exam.lib.test", appContext.getPackageName());
    }
}
lib/src/main/AndroidManifest.xml
New file
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.anyun.exam.lib" />
lib/src/main/java/com/anyun/exam/lib/AYSdk.java
New file
@@ -0,0 +1,28 @@
package com.anyun.exam.lib;
import android.content.Context;
/**
 * MyApplication2
 * Created by lzw on 2019/6/5. 13:15:20
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
class AYSdk {
    //安运驾考系统 sdk 单例模式
    private  volatile static  AYSdk ourInstance = null;
    static AYSdk getInstance() {
        if (ourInstance == null){
            synchronized (AYSdk.class){
                if (ourInstance == null){
                    ourInstance = new AYSdk();
                }
            }
        }
        return ourInstance;
    }
    private AYSdk() {
    }
}
lib/src/main/java/com/anyun/exam/lib/RemoteService.java
New file
@@ -0,0 +1,20 @@
package com.anyun.exam.lib;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
/**
 * MyApplication2
 * Created by lzw on 2019/6/5. 13:22:46
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class RemoteService extends Service {
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
lib/src/main/res/values/strings.xml
New file
@@ -0,0 +1,3 @@
<resources>
    <string name="app_name">lib</string>
</resources>
lib/src/test/java/com/anyun/exam/lib/ExampleUnitTest.java
New file
@@ -0,0 +1,17 @@
package com.anyun.exam.lib;
import org.junit.Test;
import static org.junit.Assert.*;
/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() {
        assertEquals(4, 2 + 2);
    }
}