Skip to content

Commit

Permalink
Close #22 Support native fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkil committed Apr 29, 2014
1 parent 5000db7 commit 7970ea8
Show file tree
Hide file tree
Showing 39 changed files with 2,269 additions and 0 deletions.
28 changes: 28 additions & 0 deletions progressfragment-native-sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devspark.progressfragment.sample"
android:versionCode="6"
android:versionName="1.4.0">

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19"/>

<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

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

</manifest>
23 changes: 23 additions & 0 deletions progressfragment-native-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply plugin: 'android'

dependencies {
compile project(':progressfragment-native')
}

android {
compileSdkVersion 19
buildToolsVersion '19.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 19
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
46 changes: 46 additions & 0 deletions progressfragment-native-sample/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.devspark.progressfragment</groupId>
<artifactId>parent</artifactId>
<version>1.4.0-SNAPSHOT</version>
</parent>

<artifactId>progressfragment-native-sample</artifactId>
<packaging>apk</packaging>

<name>Android ProgressFragment (Sample)</name>

<dependencies>
<!-- Library -->
<dependency>
<groupId>com.devspark.progressfragment</groupId>
<artifactId>progressfragment-native</artifactId>
<version>${project.version}</version>
<type>apklib</type>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>runLint</id>
<phase>compile</phase>
<goals>
<goal>lint</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
16 changes: 16 additions & 0 deletions progressfragment-native-sample/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19
android.library.reference.1=../progressfragment-native

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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2013, Evgeny Shishkin
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eaeaea">

<LinearLayout
android:id="@+id/progress_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp"
android:visibility="gone">

<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"/>

<TextView
android:id="@+id/progress_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:text="@string/loading"
android:textSize="14sp"
android:textStyle="bold"/>
</LinearLayout>

<FrameLayout
android:id="@+id/content_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:background="@drawable/background_card">

<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/emo_im_crying"
android:drawablePadding="8dp"
android:gravity="center"
android:padding="8dp"
android:shadowColor="#aa00"
android:shadowDx="2"
android:shadowDy="2"
android:shadowRadius="4"
android:textColor="#a00"
android:textSize="18sp"
android:textStyle="bold|italic"/>
</FrameLayout>

</RelativeLayout>
52 changes: 52 additions & 0 deletions progressfragment-native-sample/res/layout/view_content.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2013, Evgeny Shishkin
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:paddingBottom="8dp"
android:textSize="18sp"
android:textStyle="bold"
android:text="@string/title"/>

<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/new_york"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:textSize="14sp"
android:text="@string/description"/>

</LinearLayout>
</ScrollView>
26 changes: 26 additions & 0 deletions progressfragment-native-sample/res/menu/refresh.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2013, Evgeny Shishkin
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/menu_refresh"
android:icon="@drawable/ic_menu_refresh"
android:showAsAction="ifRoom"
android:title="@string/menu_refresh"/>

</menu>
48 changes: 48 additions & 0 deletions progressfragment-native-sample/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2013, Evgeny Shishkin
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>

<string name="app_name">Android-ProgressFragment-Native</string>
<string name="menu_refresh">Refresh</string>
<string name="title">New York City</string>
<string name="description">New York is the most populous city in the United States and the center of the New York
Metropolitan Area, one of the most populous urban agglomerations in the world. The city is referred to as New
York City or the City of New York to distinguish it from the State of New York, of which it is a part. A global
power city, New York exerts a significant impact upon commerce, finance, media, art, fashion, research,
technology, education, and entertainment. The home of the United Nations Headquarters, New York is an important
center for international diplomacy and has been described as the cultural capital of the world.
</string>
<string name="empty">No Data</string>
<string name="loading">Loading&#8230;</string>

<string-array name="sweets">
<item>Apple Pie</item>
<item>Banana Bread</item>
<item>Cupcake</item>
<item>Donut</item>
<item>Eclair</item>
<item>Froyo</item>
<item>Gingerbread</item>
<item>Honeycomb</item>
<item>Ice Cream Sandwich</item>
<item>Jelly Bean</item>
<item>KitKat</item>
</string-array>


</resources>
Loading

0 comments on commit 7970ea8

Please sign in to comment.