Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhenguo committed Jun 1, 2017
1 parent 50f320b commit b6f6fb6
Show file tree
Hide file tree
Showing 28 changed files with 217 additions and 33 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ dependencies {
[37]: https://github.com/jingle1267/android-utils/tree/master/util/src/main/java/com/ihongqiqu/util/ViewUtils.java
[38]: https://github.com/jingle1267/android-utils/tree/master/util/src/main/java/com/ihongqiqu/util/WindowUtils.java

[39]: https://github.com/jingle1267/android-utils/blob/master/src/com/ihongqiqu/app/BaseApplication.java
[40]: https://github.com/jingle1267/android-utils/blob/master/src/com/ihongqiqu/app/BaseCrashHandler.java
[41]: https://github.com/jingle1267/android-utils/blob/master/src/com/ihongqiqu/app/RebootThreadExceptionHandler.java
[42]: https://github.com/jingle1267/android-utils/blob/master/src/com/ihongqiqu/app/StartAppReceiver.java
[39]: https://github.com/jingle1267/android-utils/tree/master/app/src/com/ihongqiqu/app/BaseApplication.java
[40]: https://github.com/jingle1267/android-utils/tree/master/app/src/com/ihongqiqu/app/BaseCrashHandler.java
[41]: https://github.com/jingle1267/android-utils/tree/master/app/src/com/ihongqiqu/app/RebootThreadExceptionHandler.java
[42]: https://github.com/jingle1267/android-utils/tree/master/app/src/com/ihongqiqu/app/StartAppReceiver.java
[43]: http://ihongqiqu.com/2014/10/16/android-log/
[44]: http://ihongqiqu.com
[45]: https://github.com/jingle1267/android-utils/tree/master/util/src/main/java/com/ihongqiqu/util/ViewFinder.java
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "com.ihongqiqu.demo"
minSdkVersion 15
targetSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -29,7 +29,7 @@ dependencies {
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.ihongqiqu.util:android-utils:1.0.0'
compile 'com.ihongqiqu.util:android-utils:1.0.1'
// testCompile 'junit:junit:4.12'
// compile project(path: ':util')
// compile project(path: ':util')
}
18 changes: 9 additions & 9 deletions app/src/main/res/layout/activity_bitmap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="10dip"
android:orientation="vertical">
Expand All @@ -14,10 +14,10 @@
android:id="@+id/textView1"
android:layout_margin="15dp"
android:textSize="20sp"
android:gravity="left"
android:gravity="start"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="圆形图:" />
android:text="@string/str_circle_title" />

<ImageView
android:id="@+id/iv_round_origin"
Expand All @@ -34,10 +34,10 @@
android:id="@+id/textView2"
android:layout_margin="15dp"
android:textSize="20sp"
android:gravity="left"
android:gravity="start"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="合并图:" />
android:text="@string/str_combine_img" />

<ImageView
android:id="@+id/iv_round_combine"
Expand All @@ -51,10 +51,10 @@
android:background="@android:color/darker_gray" />

<TextView
android:text="高斯模糊:"
android:text="@string/str_gaosimohu"
android:layout_margin="15dp"
android:textSize="20sp"
android:gravity="left"
android:gravity="start"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

Expand All @@ -64,15 +64,15 @@

<Button
android:id="@+id/radius_small"
android:text="Radius -"
android:text="@string/str_radius_low"
android:layout_weight="1"
android:onClick="radiusSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/radius_big"
android:text="Radius +"
android:text="@string/str_radius_high"
android:layout_weight="1"
android:onClick="radiusBig"
android:layout_width="wrap_content"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textSize="20dp"
android:gravity="start"
android:textSize="20sp"
android:layout_margin="10dp"
android:text="Demos : " />
android:text="@string/str_all_demos" />

<Button
android:id="@+id/btn_bitmap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="Bitmap Demo" />
android:text="@string/str_bitmap_demo" />

<Button
android:id="@+id/btn_view_finder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="View Finder Demo" />
android:text="@string/str_view_finder_demo" />

</LinearLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_view_finder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:orientation="vertical">

<TextView
android:id="@+id/textView1"
android:textSize="24dip"
android:textSize="24sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AAAAA" />
android:text="@string/app_name" />

<Button
android:id="@+id/btn_bitmap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bitmap Demo" />
android:text="@string/app_name" />

<ImageView
android:id="@+id/imageView1"
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<resources>
<string name="app_name">demo</string>
<string name="app_name">工具类Demo</string>
<string name="str_circle_title">圆形图:</string>
<string name="str_combine_img">合并图:</string>
<string name="str_gaosimohu">高斯模糊:</string>
<string name="str_radius_low">Radius -</string>
<string name="str_radius_high">Radius +</string>
<string name="str_all_demos">Demos :</string>
<string name="str_bitmap_demo">Bitmap Demo</string>
<string name="str_view_finder_demo">View Finder Demo</string>
</resources>
1 change: 1 addition & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
33 changes: 33 additions & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "com.ihongqiqu.demo"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
testCompile 'junit:junit:4.12'
}
25 changes: 25 additions & 0 deletions demo/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/zhenguo/Documents/develop/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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,26 @@
package com.ihongqiqu.demo;

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.*;

/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.ihongqiqu.demo", appContext.getPackageName());
}
}
21 changes: 21 additions & 0 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ihongqiqu.demo" >

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
13 changes: 13 additions & 0 deletions demo/src/main/java/com/ihongqiqu/demo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.ihongqiqu.demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
19 changes: 19 additions & 0 deletions demo/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.ihongqiqu.demo.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>
Binary file added demo/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions demo/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
3 changes: 3 additions & 0 deletions demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">demo</string>
</resources>
11 changes: 11 additions & 0 deletions demo/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ publish {
userOrg = 'hongqiqu'
groupId = 'com.ihongqiqu.util'
artifactId = 'android-utils'
publishVersion = '1.0.0'
publishVersion = '1.0.1'
desc = 'android utils'
website = 'https://github.com/jingle1267/android-utils'
}
Loading

0 comments on commit b6f6fb6

Please sign in to comment.