Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and add parked text in front of text #5

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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'
}
26 changes: 23 additions & 3 deletions app/src/main/java/com/goka/sample/MainActivity.java
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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;
}

Expand Down
60 changes: 36 additions & 24 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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: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">
<com.goka.parkedtextview.ParkedTextView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/parked_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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"
/>

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" />
<Button
android:id="@+id/btn_set_text"
android:text="set text"
android:layout_above="@+id/btn_get_text"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/btn_get_text"
android:text="get text"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,5 +15,8 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jul 21 16:16:04 JST 2015
#Tue Jun 20 10:01:46 SGT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
8 changes: 4 additions & 4 deletions parkedtextview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
minSdkVersion 9
targetSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -19,5 +19,5 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:appcompat-v7:25.4.0'
}
6 changes: 1 addition & 5 deletions parkedtextview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.goka.parkedtextview">

<application android:allowBackup="true"
android:label="@string/app_name"
>

android:label="@string/app_name">
</application>

</manifest>
Loading