Skip to content

Commit aa9b42a

Browse files
committed
Renaming packages
1 parent 0568f38 commit aa9b42a

File tree

46 files changed

+1378
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1378
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# built application files
2+
*.apk
3+
*.ap_
4+
5+
# files for the dex VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# generated files
12+
bin/
13+
gen/
14+
out/
15+
build/
16+
17+
# Local configuration file (sdk path, etc)
18+
local.properties
19+
20+
# Eclipse project files
21+
.classpath
22+
.project
23+
24+
# Windows thumbnail db
25+
.DS_Store
26+
27+
# IDEA/Android Studio project files, because
28+
# the project can be imported from settings.gradle
29+
.idea
30+
*.iml
31+
32+
# Old-style IDEA project files
33+
*.ipr
34+
*.iws
35+
36+
# Local IDEA workspace
37+
.idea/workspace.xml
38+
39+
# Gradle cache
40+
.gradle
41+
42+
# Sandbox stuff
43+
_sandbox
44+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apply plugin: 'android'
2+
3+
android {
4+
compileSdkVersion 19
5+
buildToolsVersion "19.1.0"
6+
7+
defaultConfig {
8+
minSdkVersion 9
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 fileTree(dir: 'libs', include: ['*.jar'])
23+
compile 'com.android.support:appcompat-v7:19.+'
24+
}
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/chenger/android-sdks/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.elliott.chenger.autosizingtextexampleproject.app" >
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.elliott.chenger.autosizingtextexampleproject.app.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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package com.elliott.chenger.autosizingtextexampleproject.app;
2+
3+
4+
import android.app.Activity;
5+
import android.os.Bundle;
6+
import android.view.KeyEvent;
7+
import android.view.Menu;
8+
import android.view.inputmethod.EditorInfo;
9+
import android.widget.EditText;
10+
import android.widget.TextView;
11+
import android.widget.TextView.OnEditorActionListener;
12+
13+
import com.elliott.chenger.autosizingtextexampleproject.utils.TextMover;
14+
import com.elliott.chenger.autosizingtextexampleproject.view.SizeAdjustingTextView;
15+
16+
public class MainActivity extends Activity {
17+
18+
private EditText mMessageEditText;
19+
private SizeAdjustingTextView mTopMessageBox,
20+
mMiddleLeftBox, mMiddleRightBox, mBottomLeftBox,
21+
mBottomMiddleBox, mBottomRightBox;
22+
23+
@Override
24+
protected void onCreate(Bundle savedInstanceState) {
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.activity_main);
27+
28+
mMessageEditText = (EditText)findViewById(R.id.text_input);
29+
mMessageEditText.setOnEditorActionListener(actionListener);
30+
mTopMessageBox = (SizeAdjustingTextView)findViewById(R.id.topBox);
31+
32+
mMiddleLeftBox = (SizeAdjustingTextView)findViewById(R.id.middleLeftBox);
33+
mMiddleRightBox = (SizeAdjustingTextView)findViewById(R.id.middleRightBox);
34+
35+
mBottomLeftBox = (SizeAdjustingTextView)findViewById(R.id.bottomLeftBox);
36+
mBottomMiddleBox = (SizeAdjustingTextView)findViewById(R.id.bottomMiddleBox);
37+
mBottomRightBox = (SizeAdjustingTextView)findViewById(R.id.bottomRightBox);
38+
}
39+
40+
@Override
41+
public boolean onCreateOptionsMenu(Menu menu) {
42+
// Inflate the menu; this adds items to the action bar if it is present.
43+
getMenuInflater().inflate(R.menu.main, menu);
44+
return true;
45+
}
46+
47+
OnEditorActionListener actionListener = new OnEditorActionListener() {
48+
49+
@Override
50+
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
51+
boolean handled = false;
52+
String incomingText = mMessageEditText.getText().toString();
53+
if(actionId==EditorInfo.IME_ACTION_SEND && !incomingText.isEmpty()){
54+
handled = true;
55+
moveText();
56+
clearEditText();
57+
}
58+
return handled;
59+
}
60+
};
61+
62+
private void moveText() {
63+
64+
TextMover.moveTextFromCellToCell(mBottomMiddleBox, mBottomRightBox);
65+
TextMover.moveTextFromCellToCell(mBottomLeftBox, mBottomMiddleBox);
66+
TextMover.moveTextFromCellToCell(mMiddleRightBox, mBottomLeftBox);
67+
TextMover.moveTextFromCellToCell(mMiddleLeftBox, mMiddleRightBox);
68+
TextMover.moveTextFromCellToCell(mTopMessageBox, mMiddleLeftBox);
69+
String incomingText = mMessageEditText.getText().toString();
70+
TextMover.moveNewTextIntoCell(mTopMessageBox, incomingText);
71+
72+
}
73+
74+
private void clearEditText(){
75+
mMessageEditText.setText("");
76+
}
77+
78+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.elliott.chenger.autosizingtextexampleproject.utils;
2+
3+
import com.elliott.chenger.autosizingtextexampleproject.view.SizeAdjustingTextView;
4+
5+
/**
6+
* Created by chenger on 5/26/14.
7+
*/
8+
public class TextMover {
9+
public static void moveTextFromCellToCell(SizeAdjustingTextView startingCell,
10+
SizeAdjustingTextView endCell){
11+
if(!startingCell.getText().toString().isEmpty()){
12+
String text = startingCell.getText().toString();
13+
endCell.setText(text);
14+
}
15+
}
16+
17+
public static void moveNewTextIntoCell(SizeAdjustingTextView targetCell,
18+
String text){
19+
targetCell.setText(text);
20+
}
21+
}

0 commit comments

Comments
 (0)