Skip to content

Commit 39736d6

Browse files
Updates gradle versions and adds sample application
1 parent e19b05f commit 39736d6

19 files changed

Lines changed: 204 additions & 20 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
build/
22
.gradle/
3+
*.iml
4+
local.properties
5+
.idea/

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:0.8.+'
6+
classpath 'com.android.tools.build:gradle:0.9.+'
77
}
88
}

library/ant.properties

Lines changed: 0 additions & 17 deletions
This file was deleted.

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'android-library'
22

33
android {
44
compileSdkVersion 19
5-
buildToolsVersion "19.0.1"
5+
buildToolsVersion "19.0.3"
66

77
sourceSets {
88
main {

sample/build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'android'
2+
3+
android {
4+
compileSdkVersion 19
5+
buildToolsVersion "19.0.3"
6+
7+
defaultConfig {
8+
minSdkVersion 8
9+
targetSdkVersion 19
10+
versionCode 1
11+
versionName "1.0"
12+
}
13+
buildTypes {
14+
release {
15+
runProguard false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
compile 'com.android.support:appcompat-v7:+'
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
compile project(':library')
25+
}

sample/proguard-rules.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/dallas/android/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the ProGuard
5+
# include property in project.properties.
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+
#}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.meetme.android.multistateview.sample" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@drawable/ic_launcher"
8+
android:label="@string/app_name"
9+
android:theme="@style/AppTheme" >
10+
<activity
11+
android:name="com.meetme.android.multistateview.sample.MainActivity"
12+
android:label="@string/app_name" >
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package com.meetme.android.multistateview.sample;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.ActionBarActivity;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.widget.TextView;
8+
9+
import com.meetme.android.multistateview.MultiStateView;
10+
11+
12+
public class MainActivity extends ActionBarActivity {
13+
MultiStateView.ContentState mState;
14+
15+
private MultiStateView mMultiStateView;
16+
17+
private TextView mExampleOfHowToGetContentView;
18+
19+
private TextView mStateView;
20+
21+
@Override
22+
protected void onCreate(Bundle savedInstanceState) {
23+
super.onCreate(savedInstanceState);
24+
setContentView(R.layout.activity_main);
25+
26+
mStateView = (TextView) findViewById(R.id.state);
27+
mMultiStateView = (MultiStateView) findViewById(R.id.content);
28+
mState = mMultiStateView.getState();
29+
setStateText(mState);
30+
mExampleOfHowToGetContentView = (TextView) mMultiStateView.getContentView();
31+
}
32+
33+
private void setStateText(MultiStateView.ContentState state) {
34+
mStateView.setText(String.format("State: %s", state));
35+
}
36+
37+
38+
@Override
39+
public boolean onCreateOptionsMenu(Menu menu) {
40+
// Inflate the menu; this adds items to the action bar if it is present.
41+
getMenuInflater().inflate(R.menu.main, menu);
42+
return true;
43+
}
44+
45+
@Override
46+
public boolean onOptionsItemSelected(MenuItem item) {
47+
// Handle action bar item clicks here. The action bar will
48+
// automatically handle clicks on the Home/Up button, so long
49+
// as you specify a parent activity in AndroidManifest.xml.
50+
int id = item.getItemId();
51+
if (id == R.id.action_rotate_state) {
52+
// This is only done because we're rotating state; you'd typically just call direct to mMultiStateView#setState(ContentState)
53+
MultiStateView.ContentState newState = MultiStateView.ContentState.values()[(mState.ordinal() + 1) % MultiStateView.ContentState.values().length];
54+
55+
setState(newState);
56+
return true;
57+
}
58+
return super.onOptionsItemSelected(item);
59+
}
60+
61+
public void setState(MultiStateView.ContentState state) {
62+
setStateText(state);
63+
mMultiStateView.setState(state);
64+
mState = state;
65+
}
66+
67+
}
9.18 KB
Loading
5.11 KB
Loading

0 commit comments

Comments
 (0)