Browse Source

创建公共库Common,以及组件News和Girls

guiying712 9 years ago
parent
commit
8b16181baf
38 changed files with 330 additions and 1 deletions
  1. 41 0
      Common/.gitignore
  2. 25 0
      Common/build.gradle
  3. 17 0
      Common/proguard-rules.pro
  4. 8 0
      Common/src/main/AndroidManifest.xml
  5. 3 0
      Common/src/main/res/values/strings.xml
  6. 1 0
      Girls/.gitignore
  7. 26 0
      Girls/build.gradle
  8. 17 0
      Girls/proguard-rules.pro
  9. 15 0
      Girls/src/main/AndroidManifest.xml
  10. 13 0
      Girls/src/main/java/com/guiying/girls/GirlsActivity.java
  11. 13 0
      Girls/src/main/res/layout/activity_girls.xml
  12. BIN
      Girls/src/main/res/mipmap-hdpi/ic_launcher.png
  13. BIN
      Girls/src/main/res/mipmap-mdpi/ic_launcher.png
  14. BIN
      Girls/src/main/res/mipmap-xhdpi/ic_launcher.png
  15. BIN
      Girls/src/main/res/mipmap-xxhdpi/ic_launcher.png
  16. BIN
      Girls/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  17. 6 0
      Girls/src/main/res/values-w820dp/dimens.xml
  18. 6 0
      Girls/src/main/res/values/colors.xml
  19. 5 0
      Girls/src/main/res/values/dimens.xml
  20. 3 0
      Girls/src/main/res/values/strings.xml
  21. 11 0
      Girls/src/main/res/values/styles.xml
  22. 1 0
      News/.gitignore
  23. 26 0
      News/build.gradle
  24. 17 0
      News/proguard-rules.pro
  25. 15 0
      News/src/main/AndroidManifest.xml
  26. 13 0
      News/src/main/java/com/guiying/news/NewsActivity.java
  27. 13 0
      News/src/main/res/layout/activity_news.xml
  28. BIN
      News/src/main/res/mipmap-hdpi/ic_launcher.png
  29. BIN
      News/src/main/res/mipmap-mdpi/ic_launcher.png
  30. BIN
      News/src/main/res/mipmap-xhdpi/ic_launcher.png
  31. BIN
      News/src/main/res/mipmap-xxhdpi/ic_launcher.png
  32. BIN
      News/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  33. 6 0
      News/src/main/res/values-w820dp/dimens.xml
  34. 6 0
      News/src/main/res/values/colors.xml
  35. 5 0
      News/src/main/res/values/dimens.xml
  36. 3 0
      News/src/main/res/values/strings.xml
  37. 11 0
      News/src/main/res/values/styles.xml
  38. 4 1
      settings.gradle

+ 41 - 0
Common/.gitignore

@@ -0,0 +1,41 @@
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea/workspace.xml
+.idea/vcs.xml
+
+# Keystore files
+*.jks

+ 25 - 0
Common/build.gradle

@@ -0,0 +1,25 @@
+apply plugin: 'com.android.library'
+
+android {
+    compileSdkVersion 25
+    buildToolsVersion "25.0.2"
+
+    defaultConfig {
+        minSdkVersion 15
+        targetSdkVersion 25
+        versionCode 1
+        versionName "1.0"
+
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    compile fileTree(dir: 'libs', include: ['*.jar'])
+    compile 'com.android.support:appcompat-v7:25.1.0'
+}

+ 17 - 0
Common/proguard-rules.pro

@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\SDK/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 *;
+#}

+ 8 - 0
Common/src/main/AndroidManifest.xml

@@ -0,0 +1,8 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.guiying.common">
+
+    <application android:allowBackup="true" android:label="@string/app_name"
+        android:supportsRtl="true">
+
+    </application>
+
+</manifest>

+ 3 - 0
Common/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">Common</string>
+</resources>

+ 1 - 0
Girls/.gitignore

@@ -0,0 +1 @@
+/build

+ 26 - 0
Girls/build.gradle

@@ -0,0 +1,26 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 25
+    buildToolsVersion "25.0.2"
+
+    defaultConfig {
+        applicationId "com.guiying.girls"
+        minSdkVersion 15
+        targetSdkVersion 25
+        versionCode 1
+        versionName "1.0"
+
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    compile fileTree(dir: 'libs', include: ['*.jar'])
+    compile 'com.android.support:appcompat-v7:25.1.0'
+}

+ 17 - 0
Girls/proguard-rules.pro

@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\SDK/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 *;
+#}

+ 15 - 0
Girls/src/main/AndroidManifest.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.guiying.girls">
+
+    <application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme">
+        <activity android:name=".GirlsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

+ 13 - 0
Girls/src/main/java/com/guiying/girls/GirlsActivity.java

@@ -0,0 +1,13 @@
+package com.guiying.girls;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class GirlsActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_girls);
+    }
+}

+ 13 - 0
Girls/src/main/res/layout/activity_girls.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_girls"
+    android:layout_width="match_parent" android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context="com.guiying.girls.GirlsActivity">
+
+    <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:text="Hello World!" />
+</RelativeLayout>

BIN
Girls/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
Girls/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
Girls/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
Girls/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
Girls/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 6 - 0
Girls/src/main/res/values-w820dp/dimens.xml

@@ -0,0 +1,6 @@
+<resources>
+    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+         (such as screen margins) for screens with more than 820dp of available width. This
+         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+    <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>

+ 6 - 0
Girls/src/main/res/values/colors.xml

@@ -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>

+ 5 - 0
Girls/src/main/res/values/dimens.xml

@@ -0,0 +1,5 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>

+ 3 - 0
Girls/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">Girls</string>
+</resources>

+ 11 - 0
Girls/src/main/res/values/styles.xml

@@ -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>

+ 1 - 0
News/.gitignore

@@ -0,0 +1 @@
+/build

+ 26 - 0
News/build.gradle

@@ -0,0 +1,26 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 25
+    buildToolsVersion "25.0.2"
+
+    defaultConfig {
+        applicationId "com.guiying.news"
+        minSdkVersion 15
+        targetSdkVersion 25
+        versionCode 1
+        versionName "1.0"
+
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    compile fileTree(dir: 'libs', include: ['*.jar'])
+    compile 'com.android.support:appcompat-v7:25.1.0'
+}

+ 17 - 0
News/proguard-rules.pro

@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\SDK/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 *;
+#}

+ 15 - 0
News/src/main/AndroidManifest.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.guiying.news">
+
+    <application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme">
+        <activity android:name=".NewsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

+ 13 - 0
News/src/main/java/com/guiying/news/NewsActivity.java

@@ -0,0 +1,13 @@
+package com.guiying.news;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class NewsActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_news);
+    }
+}

+ 13 - 0
News/src/main/res/layout/activity_news.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_news"
+    android:layout_width="match_parent" android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context="com.guiying.news.NewsActivity">
+
+    <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:text="Hello World!" />
+</RelativeLayout>

BIN
News/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
News/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
News/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
News/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
News/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 6 - 0
News/src/main/res/values-w820dp/dimens.xml

@@ -0,0 +1,6 @@
+<resources>
+    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+         (such as screen margins) for screens with more than 820dp of available width. This
+         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+    <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>

+ 6 - 0
News/src/main/res/values/colors.xml

@@ -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>

+ 5 - 0
News/src/main/res/values/dimens.xml

@@ -0,0 +1,5 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>

+ 3 - 0
News/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">News</string>
+</resources>

+ 11 - 0
News/src/main/res/values/styles.xml

@@ -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>

+ 4 - 1
settings.gradle

@@ -1 +1,4 @@
-include ':app'
+include ':app',
+        ':Girls',
+        ':News',
+        ':Common'