Skip to content

Commit

Permalink
add: 添加EasyBar
Browse files Browse the repository at this point in the history
  • Loading branch information
SunnyQjm committed Dec 12, 2019
1 parent ba3b816 commit 101177a
Show file tree
Hide file tree
Showing 21 changed files with 651 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.appcompat:appcompat:${appcompact_version}"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation "junit:junit:${junit_version}"
implementation "androidx.constraintlayout:constraintlayout:${constraintlayout_version}"
Expand All @@ -56,17 +56,12 @@ dependencies {

implementation 'com.android.support:multidex:1.0.3'

// implementation "com.github.SunnyQjm.quickandroid:quick_android_base:${quick_android_version}"
// implementation "com.github.SunnyQjm.quickandroid:quick_android_mvp:${quick_android_version}"
// implementation "com.github.SunnyQjm.quickandroid:quick_android_qrcode:${quick_android_version}"
// implementation "com.github.SunnyQjm.quickandroid:quick_android_image_picker:${quick_android_version}"
// implementation "com.github.SunnyQjm.quickandroid:quick_android_rx_permission:${quick_android_version}"

implementation project(path: ':quick_android_base')
implementation project(path: ':quick_android_mvp')
implementation project(path: ':quick_android_qrcode')
implementation project(path: ':quick_android_image_picker')
implementation project(path: ':quick_android_rx_permission')
implementation project(path: ':quick_android_webview')
implementation project(path: ':quick_android_custom_view')
implementation project(path: ':quick_android_easy_bar')
}
28 changes: 15 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="cn.qjm253.quick_android">
xmlns:tools="http://schemas.android.com/tools"
package="cn.qjm253.quick_android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name=".App"
Expand All @@ -12,19 +15,18 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:label">
<activity android:name=".custom_view_demo.CustomViewDemoActivity">
</activity>
<activity android:name=".webview_demo.WebViewDemo">
</activity>
<activity android:name=".mvp_demo.MVPDemoActivity">
</activity>
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
tools:replace="android:label"
android:requestLegacyExternalStorage="true"
>
<activity android:name=".custom_view_demo.CustomViewDemoActivity"></activity>
<activity android:name=".webview_demo.WebViewDemo"></activity>
<activity android:name=".mvp_demo.MVPDemoActivity"></activity>
<activity android:name=".MainActivity">
<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>
</activity>
</application>
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/cn/qjm253/quick_android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import cn.qjm253.quick_android_base.base.activity.BaseQuickAndroidActivity
import cn.qjm253.quick_android_base.extensions.*
import cn.qjm253.quick_android_base.util.ContentUriUtil
import cn.qjm253.quick_android_base.util.RxSchedulersHelper
import cn.qjm253.quick_android_easy_bar.EasyBar
import cn.qjm253.quick_android_easy_bar.init
import cn.qjm253.quick_android_image_picker.openWechatStyleGallery
import cn.qjm253.quick_android_image_picker.startClipImage
import cn.qjm253.quick_android_qrcode.scanCode
import cn.qjm253.quick_android_rx_permission.QuickAndroidRxPermission
import com.qingmei2.rximagepicker_extension.MimeType
import com.qingmei2.rximagepicker_extension_wechat.WechatConfigrationBuilder
import com.qingmei2.rximagepicker_extension_zhihu.ZhihuConfigurationBuilder
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : BaseQuickAndroidActivity() {
Expand All @@ -25,6 +26,12 @@ class MainActivity : BaseQuickAndroidActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

easyBar.init(
mode = EasyBar.Mode.NONE,
title = "QuickAndroid"
)


mvpDemoBtn.setOnClickListener {
jumpTo(MVPDemoActivity::class.java)
}
Expand All @@ -46,7 +53,6 @@ class MainActivity : BaseQuickAndroidActivity() {
}, {
"complete".i()
})
// easyRequestPermissions(arrayOf(Manifest.permission.CAMERA), R.string.camera_permission_require, 2)
}

btnWechatStyleImagePicker.setOnClickListener {
Expand Down
89 changes: 61 additions & 28 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,48 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity">

<cn.qjm253.quick_android_easy_bar.EasyBar
android:id="@+id/easyBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
app:title="QuickAndroid"
android:paddingTop="5dp"
android:paddingBottom="5dp"
app:title_color="@color/white"
/>

<Button
android:text="MVPDemo"
android:id="@+id/mvpDemoBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/mvpDemoBtn" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="parent"/>
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="MVPDemo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>

<Button
android:text="scan_qr_code"
android:id="@+id/btnScanQrCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnScanQrCode" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/mvpDemoBtn" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="scan_qr_code"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mvpDemoBtn" />

<Button
android:text="Wechat Style Image Picker"
android:id="@+id/btnWechatStyleImagePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnWechatStyleImagePicker" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/btnScanQrCode" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="Wechat Style Image Picker"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnScanQrCode" />

<Button
android:text="Webview Demo"
android:id="@+id/btnWebviewDemo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnWebviewDemo" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/btnWechatStyleImagePicker"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="Webview Demo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnWechatStyleImagePicker" />

<Button
android:text="Custom view demo"
android:id="@+id/btnCustomViewDemo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnCustomViewDemo" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/btnWebviewDemo" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="Custom view demo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnWebviewDemo" />
</LinearLayout>
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ buildscript {
ext.junit_version = '4.12'
ext.test_runner_version = '1.2.0'
ext.espresso_core_version = '3.2.0'
ext.core_ktx_version = '1.0.2'
ext.core_ktx_version = '1.1.0'

ext.compile_sdk_version = 29
ext.target_sdk_version = 29
ext.min_sdk_version = 19

repositories {
google()
jcenter(){url 'http://jcenter.bintray.com/'}
jcenter() { url 'http://jcenter.bintray.com/' }

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
Expand All @@ -48,9 +48,9 @@ buildscript {
allprojects {
repositories {
google()
jcenter(){url 'http://jcenter.bintray.com/'}
jcenter() { url 'http://jcenter.bintray.com/' }
maven { url "https://jitpack.io" }

}
}

Expand Down
1 change: 1 addition & 0 deletions quick_android_easy_bar/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
36 changes: 36 additions & 0 deletions quick_android_easy_bar/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
testImplementation 'junit:junit:4.12'

implementation project(path: ':quick_android_base')
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Empty file.
21 changes: 21 additions & 0 deletions quick_android_easy_bar/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cn.qjm253.quick_android_easy_bar

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("cn.qjm253.quick_android_easy_bar.test", appContext.packageName)
}
}
2 changes: 2 additions & 0 deletions quick_android_easy_bar/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.qjm253.quick_android_easy_bar" />
Loading

0 comments on commit 101177a

Please sign in to comment.