Skip to content

Commit

Permalink
Added customization: Custom layouts, TextAppearance
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkinst committed Aug 7, 2015
1 parent 5aa3b3c commit dad9361
Show file tree
Hide file tree
Showing 43 changed files with 253 additions and 1,448 deletions.
56 changes: 50 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,51 @@
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# ignore Gradle files
.gradle/
build/

# local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Ant
build.xml

# Maven
target/
pom.xml.*
release.properties

# Eclipse
.classpath
.project
.externalToolBuilders/

# IntelliJ
*.iml
*.ipr
*.iws
.idea/
out/

# Mac
.DS_Store
/build
/captures

# Crashlytics
crashlytics.properties
crashlytics-build.properties
com_crashlytics_export_strings.xml
19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "cz.kinst.jakub.statefulviewsample"
Expand All @@ -22,4 +22,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile project(':library')
}
30 changes: 15 additions & 15 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.kinst.jakub.statefulviewsample" >
package="cz.kinst.jakub.statefulviewsample">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<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>
</application>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import com.strv.StatefulView;


public class MainActivity extends AppCompatActivity
{

StatefulView mStatefulView;


@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mStatefulView = (StatefulView) findViewById(R.id.stateful);
mStatefulView.showProgress();
}


public void showContent(View view)
{
mStatefulView.showContent();
Expand All @@ -48,28 +38,12 @@ public void showEmpty(View view)


@Override
public boolean onCreateOptionsMenu(Menu menu)
protected void onCreate(Bundle savedInstanceState)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mStatefulView = (StatefulView) findViewById(R.id.stateful);
mStatefulView.showProgress();
}


@Override
public boolean onOptionsItemSelected(MenuItem item)
{
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if(id == R.id.action_settings)
{
return true;
}

return super.onOptionsItemSelected(item);
}
}

This file was deleted.

14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:padding="@dimen/global_keyline_s"
tools:context=".MainActivity">

<LinearLayout
Expand Down Expand Up @@ -49,16 +47,18 @@
android:text="EMPTY"/>
</LinearLayout>

<cz.kinst.jakub.statefulviewsample.StatefulView
<com.strv.StatefulView
android:id="@+id/stateful"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_weight="1"
app:offlineLayout="@layout/custom_placeholder_offline"
app:stateTextAppearance="@style/TextAppearance.AppCompat.Body1">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Content"/>
</cz.kinst.jakub.statefulviewsample.StatefulView>
</com.strv.StatefulView>
</LinearLayout>
24 changes: 24 additions & 0 deletions app/src/main/res/layout/custom_placeholder_offline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="@dimen/global_keyline_s">

<TextView
android:id="@+id/placeholder_offline_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="OFFLINE"
android:textColor="#ff0000"/>

</LinearLayout>
</FrameLayout>
116 changes: 0 additions & 116 deletions app/src/main/res/layout/view/CountdownTextView.java

This file was deleted.

Loading

0 comments on commit dad9361

Please sign in to comment.