Skip to content

Commit 4c148ba

Browse files
Updated compileSdkVersion and targetSdkVersion, removed redundant casts as of compileSdkVersion 26, changed fab setVisibility(View.VISIBLE) to show(), removed unused drawables.
1 parent 39a9ef9 commit 4c148ba

File tree

22 files changed

+90
-123
lines changed

22 files changed

+90
-123
lines changed

.idea/caches/build_file_checksums.ser

546 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

-22
This file was deleted.

.idea/copyright/profiles_settings.xml

-3
This file was deleted.

.idea/gradle.xml

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+10-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml renamed to .idea/vcs.xml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
4+
compileSdkVersion 28
65
defaultConfig {
76
applicationId "com.abc.qwerty"
87
minSdkVersion 21
9-
targetSdkVersion 23
8+
targetSdkVersion 28
109
versionCode 1
1110
versionName "1.0"
1211
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -20,18 +19,16 @@ android {
2019
}
2120

2221
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25-
exclude group: 'com.android.support', module: 'support-annotations'
26-
})
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
// androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
24+
// exclude group: 'com.android.support', module: 'support-annotations'
25+
// })
2726

2827
//github library
29-
compile 'com.android.support:appcompat-v7:25.1.0'
30-
compile 'com.android.support:design:25.1.0'
31-
compile 'com.android.support:cardview-v7:25.1.0'
32-
compile 'com.android.support:recyclerview-v7:25.1.0'
33-
compile 'de.hdodenhof:circleimageview:2.1.0'
34-
compile 'com.android.support:support-v4:25.1.0'
35-
compile 'com.android.support:percent:25.1.0'
36-
testCompile 'junit:junit:4.12'
28+
implementation 'com.android.support:appcompat-v7:28.0.0'
29+
implementation 'com.android.support:design:28.0.0'
30+
implementation 'de.hdodenhof:circleimageview:2.1.0'
31+
implementation 'com.android.support:support-v4:28.0.0'
32+
implementation 'com.android.support:percent:28.0.0'
33+
// testCompile 'junit:junit:4.12'
3734
}

app/src/main/java/com/abc/qwerty/HomeActivity.java

+23-32
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ public class HomeActivity extends AppCompatActivity implements View.OnClickListe
2626
ImageView imageView;
2727

2828
FloatingActionButton fab;
29-
RelativeLayout relativeLayout_fabs;
30-
3129
FloatingActionButton fab_library;
3230
FloatingActionButton fab_xerox;
3331

@@ -42,21 +40,20 @@ protected void onCreate(Bundle savedInstanceState) {
4240

4341
setContentView(R.layout.activity_home);
4442

45-
fab = (FloatingActionButton) findViewById(R.id.fab);
46-
fab_library = (FloatingActionButton) findViewById(R.id.fab_library);
47-
fab_xerox = (FloatingActionButton) findViewById(R.id.fab_xerox);
43+
fab = findViewById(R.id.fab);
44+
fab_library = findViewById(R.id.fab_library);
45+
fab_xerox = findViewById(R.id.fab_xerox);
4846

4947
fab.setOnClickListener(new View.OnClickListener() {
5048
@Override
5149
public void onClick(View view) {
52-
RotateAnimation rotateAnimation = new RotateAnimation(fromDegrees, fromDegrees = fromDegrees+135, fab.getWidth()/2, fab.getHeight()/2);
50+
RotateAnimation rotateAnimation = new RotateAnimation(fromDegrees, fromDegrees = fromDegrees + 135, fab.getWidth() / 2, fab.getHeight() / 2);
5351
rotateAnimation.setDuration(200);
5452
rotateAnimation.setFillEnabled(true);
5553
rotateAnimation.setFillAfter(true);
5654
fab.setAnimation(rotateAnimation);
5755

5856
if ((fab_library.getVisibility() == View.INVISIBLE) || (fab_xerox.getVisibility() == View.INVISIBLE)) {
59-
6057
// get the center for the clipping circle
6158
int cx = fab_xerox.getWidth() / 2;
6259
int cy = fab_xerox.getHeight() / 2;
@@ -68,11 +65,11 @@ public void onClick(View view) {
6865
final Animator anim = ViewAnimationUtils.createCircularReveal(fab_xerox, cx, cy, 0, finalRadius);
6966

7067
// make the view visible and start the animation
71-
fab_xerox.setVisibility(View.VISIBLE);
68+
// fab_xerox.setVisibility(View.VISIBLE);
69+
fab_xerox.show();
7270

7371
anim.setDuration(200);
7472
anim.start();
75-
7673
anim.addListener(new AnimatorListenerAdapter() {
7774
@Override
7875
public void onAnimationEnd(Animator animation) {
@@ -89,13 +86,13 @@ public void onAnimationEnd(Animator animation) {
8986
ViewAnimationUtils.createCircularReveal(fab_library, cx, cy, 0, finalRadius);
9087

9188
// make the view visible and start the animation
92-
fab_library.setVisibility(View.VISIBLE);
89+
// fab_library.setVisibility(View.VISIBLE);
90+
fab_library.show();
9391
anim.setDuration(200);
9492
anim.start();
9593
}
9694
});
97-
}
98-
else{
95+
} else {
9996
final View myView = fab_library;
10097

10198
int cx = myView.getWidth() / 2;
@@ -105,19 +102,16 @@ public void onAnimationEnd(Animator animation) {
105102

106103
Animator anim =
107104
ViewAnimationUtils.createCircularReveal(myView, cx, cy, initialRadius, 0);
108-
109105
anim.addListener(new AnimatorListenerAdapter() {
110106
@Override
111107
public void onAnimationEnd(Animator animation) {
112108
super.onAnimationEnd(animation);
113109
myView.setVisibility(View.INVISIBLE);
114110
}
115111
});
116-
117112
anim.setDuration(200);
118113
// start the animation
119114
anim.start();
120-
121115
anim.addListener(new AnimatorListenerAdapter() {
122116
@Override
123117
public void onAnimationEnd(Animator animation) {
@@ -130,15 +124,13 @@ public void onAnimationEnd(Animator animation) {
130124
float initialRadius = (float) Math.hypot(cx, cy);
131125

132126
Animator anim = ViewAnimationUtils.createCircularReveal(myView, cx, cy, initialRadius, 0);
133-
134127
anim.addListener(new AnimatorListenerAdapter() {
135128
@Override
136129
public void onAnimationEnd(Animator animation) {
137130
super.onAnimationEnd(animation);
138131
myView.setVisibility(View.INVISIBLE);
139132
}
140133
});
141-
142134
anim.setDuration(200);
143135
// start the animation
144136
anim.start();
@@ -148,15 +140,15 @@ public void onAnimationEnd(Animator animation) {
148140
}
149141
});
150142

151-
final Button button_home = (Button) findViewById(R.id.button_home);
143+
final Button button_home = findViewById(R.id.button_home);
152144
button_home.setOnClickListener(this);
153-
Button button_timeline = (Button) findViewById(R.id.button_timeline);
145+
Button button_timeline = findViewById(R.id.button_timeline);
154146
button_timeline.setOnClickListener(this);
155-
final Button button_reminders = (Button) findViewById(R.id.button_reminders);
147+
final Button button_reminders = findViewById(R.id.button_reminders);
156148
button_reminders.setOnClickListener(this);
157149

158-
imageView_user = (ImageView) findViewById(R.id.imageView_user);
159-
imageView = (ImageView) findViewById(R.id.imageView);
150+
imageView_user = findViewById(R.id.imageView_user);
151+
imageView = findViewById(R.id.imageView);
160152
imageView.setOnClickListener(new View.OnClickListener() {
161153
@Override
162154
public void onClick(View v) {
@@ -194,39 +186,39 @@ public void onClick(View v) {
194186

195187
@Override
196188
public void onFragmentInteraction(Uri uri) {
197-
198189
}
199190

200191
@Override
201192
public void onClick(View v) {
202-
switch (v.getId()){
193+
switch (v.getId()) {
203194
case R.id.button_home:
204195
HomeFragment homeFragment = new HomeFragment();
205196
getSupportFragmentManager().beginTransaction()
206197
.replace(R.id.frameLayout_home, homeFragment).commit();
207-
Toast.makeText(this, "button home", Toast.LENGTH_SHORT).show();
198+
Toast.makeText(this, "Button Home", Toast.LENGTH_SHORT).show();
208199
break;
209200
case R.id.button_timeline:
210201
TimelineFragment timelineFragment = new TimelineFragment();
211202
getSupportFragmentManager().beginTransaction()
212203
.replace(R.id.frameLayout_home, timelineFragment).commit();
213-
Toast.makeText(this, "button timeline", Toast.LENGTH_SHORT).show();
204+
Toast.makeText(this, "Button Timeline", Toast.LENGTH_SHORT).show();
214205
break;
215206
case R.id.button_reminders:
216-
Toast.makeText(this, "button reminders", Toast.LENGTH_SHORT).show();
207+
Toast.makeText(this, "Button Reminders", Toast.LENGTH_SHORT).show();
217208
break;
218209
case R.id.fab_xerox:
219210
break;
220211
case R.id.fab_library:
221212
break;
222-
default: break;
213+
default:
214+
break;
223215
}
224216
}
225217

226218
@Override
227219
public void onBackPressed() {
228-
if ((fab_library.getVisibility() == View.VISIBLE) || (fab_xerox.getVisibility() == View.VISIBLE)){
229-
RotateAnimation rotateAnimation = new RotateAnimation(fromDegrees, fromDegrees = fromDegrees+135, fab.getWidth()/2, fab.getHeight()/2);
220+
if ((fab_library.getVisibility() == View.VISIBLE) || (fab_xerox.getVisibility() == View.VISIBLE)) {
221+
RotateAnimation rotateAnimation = new RotateAnimation(fromDegrees, fromDegrees = fromDegrees + 135, fab.getWidth() / 2, fab.getHeight() / 2);
230222
rotateAnimation.setDuration(200);
231223
rotateAnimation.setFillEnabled(true);
232224
rotateAnimation.setFillAfter(true);
@@ -280,8 +272,7 @@ public void onAnimationEnd(Animator animation) {
280272
anim.start();
281273
}
282274
});
283-
}
284-
else
275+
} else
285276
super.onBackPressed();
286277
}
287278
}

app/src/main/java/com/abc/qwerty/MainActivity.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ protected void onCreate(Bundle savedInstanceState) {
1515
super.onCreate(savedInstanceState);
1616
setContentView(R.layout.activity_main);
1717

18-
getSupportActionBar().setTitle(Html.fromHtml("<font color='#757575'> Login to Alphabet </font>"));
18+
getSupportActionBar().setTitle(Html.fromHtml("<font color='#757575'> Login </font>"));
1919

20-
TextView textView_signup = (TextView) findViewById(R.id.textView_signup);
20+
TextView textView_signup = findViewById(R.id.textView_signup);
2121
textView_signup.setOnClickListener(new View.OnClickListener() {
2222
@Override
2323
public void onClick(View v) {
@@ -26,7 +26,7 @@ public void onClick(View v) {
2626
}
2727
});
2828

29-
Button button_login = (Button) findViewById(R.id.button_login);
29+
Button button_login = findViewById(R.id.button_login);
3030
button_login.setOnClickListener(new View.OnClickListener() {
3131
@Override
3232
public void onClick(View v) {

0 commit comments

Comments
 (0)