驾考app界面加入背景;新建module library
| | |
| | | } |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | switch (v.getId()) { |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | |
| | | public static SupportFragment newInstance() { |
| | | |
| | | Bundle args = new Bundle(); |
| | | |
| | | PasswordFragment fragment = new PasswordFragment(); |
| | | fragment.setArguments(args); |
| | | return fragment; |
| | | } |
| | | |
| | |
| | | switch (v.getId()) { |
| | | case R.id.btn_cancle: |
| | | |
| | | pop(); |
| | | pop(); |
| | | break; |
| | | case R.id.btn_sure: |
| | | String pwd = editText.getText().toString().trim(); |
| | |
| | | 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()); |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | |
| | | android:background="@android:color/white" |
| | | > |
| | | <include layout="@layout/toolbar"/> |
| | | <FrameLayout |
| | |
| | | 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 |
| | |
| | | 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"/> |
| | |
| | | <!-- 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> |
New file |
| | |
| | | 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' |
| | | } |
New file |
| | |
| | | # 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 |
New file |
| | |
| | | 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()); |
| | | } |
| | | } |
New file |
| | |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| | | package="com.anyun.exam.lib" /> |
New file |
| | |
| | | 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() { |
| | | } |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
New file |
| | |
| | | <resources> |
| | | <string name="app_name">lib</string> |
| | | </resources> |
New file |
| | |
| | | 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); |
| | | } |
| | | } |