Skip to content

Commit 47f5738

Browse files
author
Arjun
committed
code style change
1 parent fb37ddc commit 47f5738

33 files changed

Lines changed: 882 additions & 879 deletions

File tree

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "23.0.3"
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.0"
66

7-
defaultConfig {
8-
applicationId "in.arjsna.passcodeviewsample"
9-
minSdkVersion 15
10-
targetSdkVersion 23
11-
versionCode 1
12-
versionName "1.0"
13-
}
14-
buildTypes {
15-
release {
16-
minifyEnabled false
17-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18-
}
7+
defaultConfig {
8+
applicationId "in.arjsna.passcodeviewsample"
9+
minSdkVersion 15
10+
targetSdkVersion 24
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1918
}
19+
}
2020
}
2121

2222
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
testCompile 'junit:junit:4.12'
25-
// compile 'com.android.support:appcompat-v7:23.4.0'
26-
compile 'in.arjsna:passcodeviewlib:1.1.0'
27-
// compile project(':passcodeviewlib')
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
testCompile 'junit:junit:4.12'
25+
// compile 'com.android.support:appcompat-v7:24.0.0'
26+
// compile 'in.arjsna:passcodeviewlib:1.1.0'
27+
compile project(':passcodeviewlib')
2828
}

app/src/androidTest/java/in/arjsna/passcodeviewsample/ApplicationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
88
*/
99
public class ApplicationTest extends ApplicationTestCase<Application> {
10-
public ApplicationTest() {
11-
super(Application.class);
12-
}
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
1313
}

app/src/main/AndroidManifest.xml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest package="in.arjsna.passcodeviewsample"
3-
xmlns:android="http://schemas.android.com/apk/res/android">
3+
xmlns:android="http://schemas.android.com/apk/res/android">
44

5-
<application
6-
android:allowBackup="true"
7-
android:icon="@mipmap/ic_launcher"
8-
android:label="@string/app_name"
9-
android:supportsRtl="true"
10-
android:theme="@style/AppTheme">
11-
<activity
12-
android:name=".MainActivity"
13-
android:label="@string/app_name">
14-
<intent-filter>
15-
<action android:name="android.intent.action.MAIN"/>
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity
12+
android:name=".MainActivity"
13+
android:label="@string/app_name">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN"/>
1616

17-
<category android:name="android.intent.category.LAUNCHER"/>
18-
</intent-filter>
19-
</activity>
20-
<activity android:name=".LoggedInActivity"
21-
android:label="LoggedInActivity"/>
22-
</application>
17+
<category android:name="android.intent.category.LAUNCHER"/>
18+
</intent-filter>
19+
</activity>
20+
<activity
21+
android:name=".LoggedInActivity"
22+
android:label="LoggedInActivity"/>
23+
</application>
2324

2425
</manifest>

app/src/main/java/in/arjsna/passcodeviewsample/LoggedInActivity.java

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@
66
/**
77
* Created by arjun on 8/4/16.
88
*/
9-
public class LoggedInActivity extends AppCompatActivity{
10-
@Override
11-
protected void onCreate(Bundle savedInstanceState) {
12-
overridePendingTransition(R.anim.fade_in, R.anim.slide_out_down);
13-
super.onCreate(savedInstanceState);
14-
setContentView(R.layout.logged_in_activity);
15-
}
9+
public class LoggedInActivity extends AppCompatActivity {
10+
@Override protected void onCreate(Bundle savedInstanceState) {
11+
overridePendingTransition(R.anim.fade_in, R.anim.slide_out_down);
12+
super.onCreate(savedInstanceState);
13+
setContentView(R.layout.logged_in_activity);
14+
}
1615

17-
@Override
18-
protected void onResume() {
19-
super.onResume();
20-
}
16+
@Override protected void onResume() {
17+
super.onResume();
18+
}
2119

22-
@Override
23-
public void onBackPressed() {
24-
super.onBackPressed();
25-
overridePendingTransition(R.anim.fade_in, R.anim.slide_out_down);
26-
}
20+
@Override public void onBackPressed() {
21+
super.onBackPressed();
22+
overridePendingTransition(R.anim.fade_in, R.anim.slide_out_down);
23+
}
2724
}

app/src/main/java/in/arjsna/passcodeviewsample/MainActivity.java

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,58 +11,54 @@
1111
import in.arjsna.passcodeview.PassCodeView;
1212

1313
public class MainActivity extends AppCompatActivity {
14-
private final String PASSCODE = "3322";
15-
private PassCodeView passCodeView;
14+
private final String PASSCODE = "3322";
15+
private PassCodeView passCodeView;
1616

17-
@Override
18-
protected void onCreate(Bundle savedInstanceState) {
19-
super.onCreate(savedInstanceState);
20-
setContentView(R.layout.activity_main);
21-
passCodeView = (PassCodeView) findViewById(R.id.pass_code_view);
22-
TextView promptView = (TextView) findViewById(R.id.promptview);
23-
Typeface typeFace = Typeface.createFromAsset(getAssets(), "fonts/Font-Bold.ttf");
24-
passCodeView.setTypeFace(typeFace);
25-
passCodeView.setKeyTextColor(R.color.black_shade);
26-
promptView.setTypeface(typeFace);
27-
bindEvents();
28-
}
29-
30-
private void bindEvents() {
31-
passCodeView.setOnTextChangeListener(new PassCodeView.TextChangeListener() {
32-
@Override
33-
public void onTextChanged(String text) {
34-
if (text.length() == 4) {
35-
if (text.equals(PASSCODE)) {
36-
Intent intent = new Intent(MainActivity.this, LoggedInActivity.class);
37-
startActivity(intent);
38-
finish();
39-
} else {
40-
passCodeView.setError(true);
41-
}
42-
}
43-
}
44-
});
45-
}
17+
@Override protected void onCreate(Bundle savedInstanceState) {
18+
super.onCreate(savedInstanceState);
19+
setContentView(R.layout.activity_main);
20+
passCodeView = (PassCodeView) findViewById(R.id.pass_code_view);
21+
TextView promptView = (TextView) findViewById(R.id.promptview);
22+
Typeface typeFace = Typeface.createFromAsset(getAssets(), "fonts/Font-Bold.ttf");
23+
passCodeView.setTypeFace(typeFace);
24+
passCodeView.setKeyTextColor(R.color.black_shade);
25+
promptView.setTypeface(typeFace);
26+
bindEvents();
27+
}
4628

47-
@Override
48-
public boolean onCreateOptionsMenu(Menu menu) {
49-
// Inflate the menu; this adds items to the action bar if it is present.
50-
getMenuInflater().inflate(R.menu.menu_main, menu);
51-
return true;
52-
}
29+
private void bindEvents() {
30+
passCodeView.setOnTextChangeListener(new PassCodeView.TextChangeListener() {
31+
@Override public void onTextChanged(String text) {
32+
if (text.length() == 4) {
33+
if (text.equals(PASSCODE)) {
34+
Intent intent = new Intent(MainActivity.this, LoggedInActivity.class);
35+
startActivity(intent);
36+
finish();
37+
} else {
38+
passCodeView.setError(true);
39+
}
40+
}
41+
}
42+
});
43+
}
5344

54-
@Override
55-
public boolean onOptionsItemSelected(MenuItem item) {
56-
// Handle action bar item clicks here. The action bar will
57-
// automatically handle clicks on the Home/Up button, so long
58-
// as you specify a parent activity in AndroidManifest.xml.
59-
int id = item.getItemId();
45+
@Override public boolean onCreateOptionsMenu(Menu menu) {
46+
// Inflate the menu; this adds items to the action bar if it is present.
47+
getMenuInflater().inflate(R.menu.menu_main, menu);
48+
return true;
49+
}
6050

61-
//noinspection SimplifiableIfStatement
62-
if (id == R.id.action_settings) {
63-
return true;
64-
}
51+
@Override public boolean onOptionsItemSelected(MenuItem item) {
52+
// Handle action bar item clicks here. The action bar will
53+
// automatically handle clicks on the Home/Up button, so long
54+
// as you specify a parent activity in AndroidManifest.xml.
55+
int id = item.getItemId();
6556

66-
return super.onOptionsItemSelected(item);
57+
//noinspection SimplifiableIfStatement
58+
if (id == R.id.action_settings) {
59+
return true;
6760
}
61+
62+
return super.onOptionsItemSelected(item);
63+
}
6864
}

app/src/main/res/anim/fade_in.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<set xmlns:android="http://schemas.android.com/apk/res/android">
3-
<alpha
4-
android:duration="200"
5-
android:fillAfter="true"
6-
android:fromAlpha="0.9"
7-
android:toAlpha="1" />
3+
<alpha
4+
android:duration="200"
5+
android:fillAfter="true"
6+
android:fromAlpha="0.9"
7+
android:toAlpha="1"/>
88
</set>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<set xmlns:android="http://schemas.android.com/apk/res/android">
3-
<translate
4-
android:duration="500"
5-
android:fillAfter="true"
6-
android:fromYDelta="0%p"
7-
android:toYDelta="100%p" />
3+
<translate
4+
android:duration="500"
5+
android:fillAfter="true"
6+
android:fromYDelta="0%p"
7+
android:toYDelta="100%p"/>
88
</set>

0 commit comments

Comments
 (0)