diff --git a/app/build.gradle b/app/build.gradle index 3a5c40e..0df1258 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 22 - buildToolsVersion "23.0.0 rc2" + compileSdkVersion 25 + buildToolsVersion "25.0.3" defaultConfig { applicationId "com.goka.parkedtextview" minSdkVersion 9 - targetSdkVersion 22 + targetSdkVersion 25 versionCode 1 versionName "1.0" } @@ -22,5 +22,5 @@ android { dependencies { compile project(':parkedtextview') compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:22.2.1' + compile 'com.android.support:appcompat-v7:25.4.0' } diff --git a/app/src/main/java/com/goka/sample/MainActivity.java b/app/src/main/java/com/goka/sample/MainActivity.java index 78768ac..245437d 100644 --- a/app/src/main/java/com/goka/sample/MainActivity.java +++ b/app/src/main/java/com/goka/sample/MainActivity.java @@ -1,13 +1,17 @@ package com.goka.sample; -import com.goka.parkedtextview.ParkedTextView; - -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; + +import com.goka.parkedtextview.ParkedTextView; public class MainActivity extends AppCompatActivity { + ParkedTextView mParkedTextView; @Override protected void onCreate(Bundle savedInstanceState) { @@ -19,6 +23,22 @@ protected void onCreate(Bundle savedInstanceState) { public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); + mParkedTextView = (ParkedTextView) findViewById(R.id.parked_text_view); + Button setButton = (Button) findViewById(R.id.btn_set_text); + Button getButton = (Button) findViewById(R.id.btn_get_text); + setButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + mParkedTextView.setTypedText("test"); + } + }); + getButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Toast.makeText(MainActivity.this, mParkedTextView.getTypedText(), + Toast.LENGTH_SHORT).show(); + } + }); return true; } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 61666f1..7b50cbe 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,27 +1,39 @@ - + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" + android:paddingBottom="@dimen/activity_vertical_margin" + tools:context=".MainActivity" + android:background="#ffaa66cc"> - + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/parked_text_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:background="@android:color/transparent" + android:layout_centerInParent="true" + android:textSize="24sp" + app:parkedText=".slack.com" + app:parkedHint="yourteam" + app:parkedTextColor="FFFFFF" + app:parkedHintColor="CCCCCC" + app:parkedTextBold="true" /> +