11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "26.0.2"
6 | defaultConfig {
7 | applicationId "com.itheima.screenadaptdemo"
8 | minSdkVersion 16
9 | targetSdkVersion 26
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:26.1.0'
28 | testCompile 'junit:junit:4.12'
29 |
30 | compile 'com.android.support:percent:26.1.0'
31 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
32 | }
33 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\software\AndroidStudio\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/itheima/screenadaptdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.itheima.screenadaptdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.itheima.screenadaptdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/itheima/screenadaptdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.itheima.screenadaptdemo;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.percent_layout);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/send_msg_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/app/src/main/res/drawable/send_msg_normal.9.png
--------------------------------------------------------------------------------
/app/src/main/res/layout-land/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
16 |
17 |
22 |
23 |
28 |
29 |
30 |
34 |
35 |
40 |
41 |
46 |
47 |
48 |
49 |
55 |
56 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-large/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-port/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
16 |
17 |
22 |
23 |
28 |
29 |
30 |
34 |
35 |
40 |
41 |
46 |
47 |
48 |
49 |
55 |
56 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-sw600dp-land/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-sw600dp-port/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-sw600dp/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
16 |
17 |
22 |
23 |
28 |
29 |
30 |
34 |
35 |
40 |
41 |
46 |
47 |
48 |
49 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_twopanes.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/constraint_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
24 |
25 |
31 |
32 |
38 |
39 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dimen_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/percent_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-480x800/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 113dp
3 | 100dp
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values-large/layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | @layout/activity_twopanes
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw600dp/layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | @layout/activity_twopanes
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 180dp
6 | 160dp
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | @layout/activity_main
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ScreenAdaptDemo
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/itheima/screenadaptdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.itheima.screenadaptdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.0.0'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | google()
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uncleleonfan/ScreenAdaptDemo/129d10702811344a7a4d0d6a7832a9b8e915cf04/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Dec 09 18:07:51 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/import-summary.txt:
--------------------------------------------------------------------------------
1 | ECLIPSE ANDROID PROJECT IMPORT SUMMARY
2 | ======================================
3 |
4 | Ignored Files:
5 | --------------
6 | The following files were *not* copied into the new Gradle project; you
7 | should evaluate whether these are still needed in your project and if
8 | so manually move them:
9 |
10 | * _index.html
11 | * proguard.cfg
12 |
13 | Replaced Jars with Dependencies:
14 | --------------------------------
15 | The importer recognized the following .jar files as third party
16 | libraries and replaced them with Gradle dependencies instead. This has
17 | the advantage that more explicit version information is known, and the
18 | libraries can be updated automatically. However, it is possible that
19 | the .jar file in your project was of an older version than the
20 | dependency we picked, which could render the project not compileable.
21 | You can disable the jar replacement in the import wizard and try again:
22 |
23 | android-support-v4.jar => com.android.support:support-v4:18.+
24 |
25 | Moved Files:
26 | ------------
27 | Android Gradle projects use a different directory structure than ADT
28 | Eclipse projects. Here's how the projects were restructured:
29 |
30 | * AndroidManifest.xml => newsreader\src\main\AndroidManifest.xml
31 | * res\ => newsreader\src\main\res\
32 | * src\ => newsreader\src\main\java\
33 |
34 | Missing Android Support Repository:
35 | -----------------------------------
36 | Some useful libraries, such as the Android Support Library, are
37 | installed from a special Maven repository, which should be installed
38 | via the SDK manager.
39 |
40 | It looks like this library is missing from your SDK installation at:
41 | null
42 |
43 | To install it, open the SDK manager, and in the Extras category,
44 | select "Android Support Repository". You may also want to install the
45 | "Google Repository" if you want to use libraries like Google Play
46 | Services.
47 |
48 | Next Steps:
49 | -----------
50 | You can now build the project. The Gradle project needs network
51 | connectivity to download dependencies.
52 |
53 | Bugs:
54 | -----
55 | If for some reason your project does not build, and you determine that
56 | it is due to a bug or limitation of the Eclipse to Gradle importer,
57 | please file a bug at http://b.android.com with category
58 | Component-Tools.
59 |
60 | (This import summary is for your information only, and can be deleted
61 | after import once you are satisfied with the results.)
62 |
--------------------------------------------------------------------------------
/newsreader/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "26.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.android.newsreader"
9 | minSdkVersion 15
10 | targetSdkVersion 26
11 | }
12 |
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile 'com.android.support:support-v4:18.+'
23 | }
24 |
--------------------------------------------------------------------------------
/newsreader/build/generated/source/buildConfig/androidTest/debug/com/example/android/newsreader/test/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package com.example.android.newsreader.test;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = Boolean.parseBoolean("true");
8 | public static final String APPLICATION_ID = "com.example.android.newsreader.test";
9 | public static final String BUILD_TYPE = "debug";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = -1;
12 | public static final String VERSION_NAME = "";
13 | }
14 |
--------------------------------------------------------------------------------
/newsreader/build/generated/source/buildConfig/debug/com/example/android/newsreader/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package com.example.android.newsreader;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = Boolean.parseBoolean("true");
8 | public static final String APPLICATION_ID = "com.example.android.newsreader";
9 | public static final String BUILD_TYPE = "debug";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = 1;
12 | public static final String VERSION_NAME = "1.0";
13 | }
14 |
--------------------------------------------------------------------------------
/newsreader/build/generated/source/r/debug/com/example/android/newsreader/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.example.android.newsreader;
9 |
10 | public final class R {
11 | public static final class bool {
12 | public static final int has_two_panes=0x7f010000;
13 | }
14 | public static final class drawable {
15 | public static final int button_bg=0x7f020000;
16 | public static final int button_normal=0x7f020001;
17 | public static final int button_pressed=0x7f020002;
18 | public static final int icon=0x7f020003;
19 | public static final int logo=0x7f020004;
20 | public static final int tab_bg=0x7f020005;
21 | public static final int tab_bg_normal=0x7f020006;
22 | public static final int tab_bg_selected=0x7f020007;
23 | }
24 | public static final class id {
25 | public static final int article=0x7f030000;
26 | public static final int categorybutton=0x7f030001;
27 | public static final int headlines=0x7f030002;
28 | public static final int imageView1=0x7f030003;
29 | public static final int linearLayout1=0x7f030004;
30 | public static final int view1=0x7f030005;
31 | }
32 | public static final class layout {
33 | public static final int actionbar_list_item=0x7f040000;
34 | public static final int headline_item=0x7f040001;
35 | public static final int main_layout=0x7f040002;
36 | public static final int onepane=0x7f040003;
37 | public static final int onepane_with_bar=0x7f040004;
38 | public static final int twopanes=0x7f040005;
39 | public static final int twopanes_narrow=0x7f040006;
40 | }
41 | public static final class string {
42 | public static final int app_name=0x7f050000;
43 | public static final int hello=0x7f050001;
44 | }
45 | public static final class style {
46 | public static final int CategoryButtonStyle=0x7f060000;
47 | public static final int CustomActionBarTabStyle=0x7f060001;
48 | public static final int CustomActionBarTabTextStyle=0x7f060002;
49 | public static final int NewsReaderStyle=0x7f060003;
50 | public static final int NewsReaderStyle_NoActionBar=0x7f060004;
51 | }
52 | }
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/compileDebugAidl/dependency.store:
--------------------------------------------------------------------------------
1 | 
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/compileDebugAndroidTestAidl/dependency.store:
--------------------------------------------------------------------------------
1 | 
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugAndroidTestResources/compile-file-map.properties:
--------------------------------------------------------------------------------
1 | #Sat Dec 09 18:09:35 CST 2017
2 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugAndroidTestResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/compile-file-map.properties:
--------------------------------------------------------------------------------
1 | #Sat Dec 09 18:09:34 CST 2017
2 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-xhdpi\\tab_bg_selected.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi_tab_bg_selected.9.png.flat
3 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-hdpi\\button_pressed.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi_button_pressed.9.png.flat
4 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-mdpi\\button_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi_button_normal.9.png.flat
5 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-ldpi\\button_pressed.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-ldpi_button_pressed.9.png.flat
6 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-hdpi\\button_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi_button_normal.9.png.flat
7 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-mdpi\\button_pressed.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi_button_pressed.9.png.flat
8 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-ldpi\\icon.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-ldpi_icon.png.flat
9 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-xhdpi\\icon.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi_icon.png.flat
10 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\layout\\onepane.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\layout_onepane.xml.flat
11 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-ldpi\\tab_bg_selected.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-ldpi_tab_bg_selected.9.png.flat
12 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\layout\\onepane_with_bar.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\layout_onepane_with_bar.xml.flat
13 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-mdpi\\tab_bg_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi_tab_bg_normal.9.png.flat
14 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable\\tab_bg.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable_tab_bg.xml.flat
15 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-hdpi\\tab_bg_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi_tab_bg_normal.9.png.flat
16 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\layout\\twopanes.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\layout_twopanes.xml.flat
17 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-mdpi\\tab_bg_selected.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi_tab_bg_selected.9.png.flat
18 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-mdpi\\icon.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi_icon.png.flat
19 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-xhdpi\\tab_bg_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi_tab_bg_normal.9.png.flat
20 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-xhdpi\\button_pressed.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi_button_pressed.9.png.flat
21 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable\\button_bg.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable_button_bg.xml.flat
22 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-hdpi\\icon.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi_icon.png.flat
23 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-xhdpi\\logo.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi_logo.png.flat
24 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-ldpi\\logo.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-ldpi_logo.png.flat
25 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-xhdpi\\button_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi_button_normal.9.png.flat
26 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\layout\\actionbar_list_item.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\layout_actionbar_list_item.xml.flat
27 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\layout\\twopanes_narrow.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\layout_twopanes_narrow.xml.flat
28 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-mdpi\\logo.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-mdpi_logo.png.flat
29 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-ldpi\\tab_bg_normal.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-ldpi_tab_bg_normal.9.png.flat
30 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-hdpi\\tab_bg_selected.9.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi_tab_bg_selected.9.png.flat
31 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\layout\\headline_item.xml=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\layout_headline_item.xml.flat
32 | C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\src\\main\\res\\drawable-hdpi\\logo.png=C\:\\Work\\workspace\\AndroidStudioProjects\\ScreenAdaptDemo\\newsreader\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi_logo.png.flat
33 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merged.dir/values-sw600dp-land-v13/values-sw600dp-land-v13.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | @layout/twopanes
5 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merged.dir/values-sw600dp-port-v13/values-sw600dp-port-v13.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | @layout/onepane
5 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v11/values-v11.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | @layout/onepane
5 |
10 |
15 |
19 |
21 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merged.dir/values-xlarge-land-v4/values-xlarge-land-v4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | @layout/twopanes
5 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merged.dir/values-xlarge-port-v4/values-xlarge-port-v4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | @layout/twopanes_narrow
5 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | @layout/onepane_with_bar
5 | NewsReader
6 | Hello World, NewsReaderActivity!
7 |
10 |
12 |
14 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/incremental/mergeDebugResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 | @layout/onepane_with_barfalseHello World, NewsReaderActivity!NewsReader@layout/twopanestrue@layout/onepanefalse@layout/onepanefalse@layout/twopanestrue@layout/twopanes_narrowtrue
--------------------------------------------------------------------------------
/newsreader/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/newsreader/build/intermediates/manifests/full/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
25 |
26 |
31 |
32 |
38 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/newsreader/build/outputs/logs/manifest-merger-debug-report.txt:
--------------------------------------------------------------------------------
1 | -- Merging decision tree log ---
2 | manifest
3 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
4 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
5 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
6 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
7 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
8 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
9 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:1-39:12
10 | package
11 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:18:7-47
12 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
13 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
14 | android:versionName
15 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:20:7-32
16 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
17 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
18 | xmlns:android
19 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:17:11-69
20 | android:versionCode
21 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:19:7-30
22 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
23 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
24 | uses-sdk
25 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:5-73
26 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:5-73
27 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:5-73
28 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:5-73
29 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:5-73
30 | android:targetSdkVersion
31 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:41-70
32 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
33 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
34 | android:minSdkVersion
35 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:21:15-40
36 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
37 | INJECTED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml
38 | supports-screens
39 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:22:5-26:40
40 | android:largeScreens
41 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:25:9-36
42 | android:smallScreens
43 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:23:9-36
44 | android:normalScreens
45 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:24:9-37
46 | android:xlargeScreens
47 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:26:9-37
48 | application
49 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:28:5-38:19
50 | android:label
51 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:28:48-80
52 | android:icon
53 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:28:18-47
54 | android:theme
55 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:29:48-86
56 | android:logo
57 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:29:18-47
58 | activity#com.example.android.newsreader.NewsReaderActivity
59 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:30:9-35:20
60 | android:label
61 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:30:54-86
62 | android:name
63 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:30:19-53
64 | intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
65 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:31:13-34:29
66 | action#android.intent.action.MAIN
67 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:32:17-69
68 | android:name
69 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:32:25-66
70 | category#android.intent.category.LAUNCHER
71 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:33:17-77
72 | android:name
73 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:33:27-74
74 | activity#com.example.android.newsreader.ArticleActivity
75 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:36:9-37:72
76 | android:theme
77 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:37:19-69
78 | android:name
79 | ADDED from C:\Work\workspace\AndroidStudioProjects\ScreenAdaptDemo\newsreader\src\main\AndroidManifest.xml:36:19-50
80 |
--------------------------------------------------------------------------------
/newsreader/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
21 |
22 |
27 |
28 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/newsreader/src/main/java/com/example/android/newsreader/ArticleActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.newsreader;
18 |
19 | import android.content.res.Configuration;
20 | import android.os.Bundle;
21 | import android.support.v4.app.FragmentActivity;
22 |
23 | /**
24 | * Activity that displays a particular news article onscreen.
25 | *
26 | * This activity is started only when the screen is not large enough for a two-pane layout, in
27 | * which case this separate activity is shown in order to display the news article. This activity
28 | * kills itself if the display is reconfigured into a shape that allows a two-pane layout, since
29 | * in that case the news article will be displayed by the {@link NewsReaderActivity} and this
30 | * Activity therefore becomes unnecessary.
31 | */
32 | public class ArticleActivity extends FragmentActivity {
33 | // The news category index and the article index for the article we are to display
34 | int mCatIndex, mArtIndex;
35 |
36 | /**
37 | * Sets up the activity.
38 | *
39 | * Setting up the activity means reading the category/article index from the Intent that
40 | * fired this Activity and loading it onto the UI. We also detect if there has been a
41 | * screen configuration change (in particular, a rotation) that makes this activity
42 | * unnecessary, in which case we do the honorable thing and get out of the way.
43 | */
44 | @Override
45 | protected void onCreate(Bundle savedInstanceState) {
46 | super.onCreate(savedInstanceState);
47 | mCatIndex = getIntent().getExtras().getInt("catIndex", 0);
48 | mArtIndex = getIntent().getExtras().getInt("artIndex", 0);
49 |
50 | // If we are in two-pane layout mode, this activity is no longer necessary
51 | if (getResources().getBoolean(R.bool.has_two_panes)) {
52 | finish();
53 | return;
54 | }
55 |
56 | // Place an ArticleFragment as our content pane
57 | ArticleFragment f = new ArticleFragment();
58 | getSupportFragmentManager().beginTransaction().add(android.R.id.content, f).commit();
59 |
60 | // Display the correct news article on the fragment
61 | NewsArticle article = NewsSource.getInstance().getCategory(mCatIndex).getArticle(mArtIndex);
62 | f.displayArticle(article);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/newsreader/src/main/java/com/example/android/newsreader/ArticleFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.newsreader;
18 |
19 | import android.os.Bundle;
20 | import android.support.v4.app.Fragment;
21 | import android.view.LayoutInflater;
22 | import android.view.View;
23 | import android.view.ViewGroup;
24 | import android.webkit.WebView;
25 |
26 | /**
27 | * Fragment that displays a news article.
28 | */
29 | public class ArticleFragment extends Fragment {
30 | // The webview where we display the article (our only view)
31 | WebView mWebView;
32 |
33 | // The article we are to display
34 | NewsArticle mNewsArticle = null;
35 |
36 | // Parameterless constructor is needed by framework
37 | public ArticleFragment() {
38 | super();
39 | }
40 |
41 | /**
42 | * Sets up the UI. It consists if a single WebView.
43 | */
44 | @Override
45 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
46 | mWebView = new WebView(getActivity());
47 | loadWebView();
48 | return mWebView;
49 | }
50 |
51 | /**
52 | * Displays a particular article.
53 | *
54 | * @param article the article to display
55 | */
56 | public void displayArticle(NewsArticle article) {
57 | mNewsArticle = article;
58 | loadWebView();
59 | }
60 |
61 | /**
62 | * Loads article data into the webview.
63 | *
64 | * This method is called internally to update the webview's contents to the appropriate
65 | * article's text.
66 | */
67 | void loadWebView() {
68 | if (mWebView != null) {
69 | mWebView.loadData(mNewsArticle == null ? "" : mNewsArticle.getBody(), "text/html",
70 | "utf-8");
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/newsreader/src/main/java/com/example/android/newsreader/CompatActionBarNavHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.newsreader;
18 |
19 | import android.app.ActionBar.OnNavigationListener;
20 | import android.app.ActionBar.Tab;
21 | import android.app.ActionBar.TabListener;
22 | import android.app.FragmentTransaction;
23 |
24 | /**
25 | * Adapter for action bar navigation events.
26 | *
27 | * This class implements an adapter that facilitates handling of action bar navigation events.
28 | * An instance of this class must be installed as a TabListener or OnNavigationListener on an
29 | * Action Bar, and it will relay the navigation events to a configured listener
30 | * (a {@link CompatActionBarNavListener}).
31 | *
32 | * This class should only be instanced and used on Android platforms that support the Action Bar,
33 | * that is, SDK level 11 and above.
34 | */
35 | public class CompatActionBarNavHandler implements TabListener, OnNavigationListener {
36 | // The listener that we notify of navigation events
37 | CompatActionBarNavListener mNavListener;
38 |
39 | /**
40 | * Constructs an instance with the given listener.
41 | *
42 | * @param listener the listener to notify when a navigation event occurs.
43 | */
44 | public CompatActionBarNavHandler(CompatActionBarNavListener listener) {
45 | mNavListener = listener;
46 | }
47 |
48 | /**
49 | * Called by framework when a tab is selected.
50 | *
51 | * This will cause a navigation event to be delivered to the configured listener.
52 | */
53 | @Override
54 | public void onTabSelected(Tab tab, FragmentTransaction ft) {
55 | // TODO Auto-generated method stub
56 | mNavListener.onCategorySelected(tab.getPosition());
57 | }
58 |
59 | /**
60 | * Called by framework when a item on the navigation menu is selected.
61 | *
62 | * This will cause a navigation event to be delivered to the configured listener.
63 | */
64 | @Override
65 | public boolean onNavigationItemSelected(int itemPosition, long itemId) {
66 | mNavListener.onCategorySelected(itemPosition);
67 | return true;
68 | }
69 |
70 |
71 | /**
72 | * Called by framework when a tab is re-selected. That is, it was already selected and is
73 | * tapped on again. This is not used in our app.
74 | */
75 | @Override
76 | public void onTabReselected(Tab tab, FragmentTransaction ft) {
77 | // we don't care
78 | }
79 |
80 | /**
81 | * Called by framework when a tab is unselected. Not used in our app.
82 | */
83 | @Override
84 | public void onTabUnselected(Tab tab, FragmentTransaction ft) {
85 | // we don't care
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/newsreader/src/main/java/com/example/android/newsreader/CompatActionBarNavListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.newsreader;
18 |
19 | /**
20 | * A listener that listens to navigation events.
21 | *
22 | * Represents a listener for navigation events delivered by {@link CompatActionBarNavHandler}.
23 | */
24 | public interface CompatActionBarNavListener {
25 | /**
26 | * Signals that the given news category was selected.
27 | * @param catIndex the selected category's index.
28 | */
29 | public void onCategorySelected(int catIndex);
30 | }
31 |
--------------------------------------------------------------------------------
/newsreader/src/main/java/com/example/android/newsreader/HeadlinesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.newsreader;
18 |
19 | import android.os.Bundle;
20 | import android.support.v4.app.ListFragment;
21 | import android.view.View;
22 | import android.widget.AdapterView;
23 | import android.widget.AdapterView.OnItemClickListener;
24 | import android.widget.ArrayAdapter;
25 | import android.widget.ListView;
26 |
27 | import java.util.ArrayList;
28 | import java.util.List;
29 |
30 | /**
31 | * Fragment that displays the news headlines for a particular news category.
32 | *
33 | * This Fragment displays a list with the news headlines for a particular news category.
34 | * When an item is selected, it notifies the configured listener that a headlines was selected.
35 | */
36 | public class HeadlinesFragment extends ListFragment implements OnItemClickListener {
37 | // The list of headlines that we are displaying
38 | List mHeadlinesList = new ArrayList();
39 |
40 | // The list adapter for the list we are displaying
41 | ArrayAdapter mListAdapter;
42 |
43 | // The listener we are to notify when a headline is selected
44 | OnHeadlineSelectedListener mHeadlineSelectedListener = null;
45 |
46 | /**
47 | * Represents a listener that will be notified of headline selections.
48 | */
49 | public interface OnHeadlineSelectedListener {
50 | /**
51 | * Called when a given headline is selected.
52 | * @param index the index of the selected headline.
53 | */
54 | public void onHeadlineSelected(int index);
55 | }
56 |
57 | /**
58 | * Default constructor required by framework.
59 | */
60 | public HeadlinesFragment() {
61 | super();
62 | }
63 |
64 | @Override
65 | public void onStart() {
66 | super.onStart();
67 | setListAdapter(mListAdapter);
68 | getListView().setOnItemClickListener(this);
69 | loadCategory(0);
70 | }
71 |
72 | @Override
73 | public void onCreate(Bundle savedInstanceState) {
74 | super.onCreate(savedInstanceState);
75 | mListAdapter = new ArrayAdapter(getActivity(), R.layout.headline_item,
76 | mHeadlinesList);
77 | }
78 |
79 | /**
80 | * Sets the listener that should be notified of headline selection events.
81 | * @param listener the listener to notify.
82 | */
83 | public void setOnHeadlineSelectedListener(OnHeadlineSelectedListener listener) {
84 | mHeadlineSelectedListener = listener;
85 | }
86 |
87 | /**
88 | * Load and display the headlines for the given news category.
89 | * @param categoryIndex the index of the news category to display.
90 | */
91 | public void loadCategory(int categoryIndex) {
92 | mHeadlinesList.clear();
93 | int i;
94 | NewsCategory cat = NewsSource.getInstance().getCategory(categoryIndex);
95 | for (i = 0; i < cat.getArticleCount(); i++) {
96 | mHeadlinesList.add(cat.getArticle(i).getHeadline());
97 | }
98 | mListAdapter.notifyDataSetChanged();
99 | }
100 |
101 | /**
102 | * Handles a click on a headline.
103 | *
104 | * This causes the configured listener to be notified that a headline was selected.
105 | */
106 | @Override
107 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
108 | if (null != mHeadlineSelectedListener) {
109 | mHeadlineSelectedListener.onHeadlineSelected(position);
110 | }
111 | }
112 |
113 | /** Sets choice mode for the list
114 | *
115 | * @param selectable whether list is to be selectable.
116 | */
117 | public void setSelectable(boolean selectable) {
118 | if (selectable) {
119 | getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
120 | }
121 | else {
122 | getListView().setChoiceMode(ListView.CHOICE_MODE_NONE);
123 | }
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/newsreader/src/main/java/com/example/android/newsreader/NewsArticle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.newsreader;
18 |
19 | /**
20 | * A news article.
21 | *
22 | * An article consists of a headline and a body. In this example app, article text is dynamically
23 | * generated nonsense.
24 | */
25 | public class NewsArticle {
26 | // How many sentences in each paragraph?
27 | final int SENTENCES_PER_PARAGRAPH = 20;
28 |
29 | // How many paragraphs in each article?
30 | final int PARAGRAPHS_PER_ARTICLE = 5;
31 |
32 | // Headline and body
33 | String mHeadline, mBody;
34 |
35 | /**
36 | * Create a news article with randomly generated text.
37 | * @param ngen the nonsense generator to use.
38 | */
39 | public NewsArticle(NonsenseGenerator ngen) {
40 | mHeadline = ngen.makeHeadline();
41 |
42 | StringBuilder sb = new StringBuilder();
43 | sb.append("");
44 | sb.append("
" + mHeadline + "
");
45 | int i;
46 | for (i = 0; i < PARAGRAPHS_PER_ARTICLE; i++) {
47 | sb.append("