Merge branch 'theZacAttacks-better_fab_fix'
This commit is contained in:
commit
3a0fc9d3db
3 changed files with 28 additions and 4 deletions
|
@ -44,7 +44,6 @@ dependencies {
|
||||||
compile 'com.jakewharton:butterknife:8.4.0'
|
compile 'com.jakewharton:butterknife:8.4.0'
|
||||||
compile 'com.google.firebase:firebase-messaging:10.0.1'
|
compile 'com.google.firebase:firebase-messaging:10.0.1'
|
||||||
compile 'com.google.firebase:firebase-crash:10.0.1'
|
compile 'com.google.firebase:firebase-crash:10.0.1'
|
||||||
compile 'com.github.bluzwong:swipeback:0.2.0@aar'
|
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,14 +294,27 @@ public class AccountActivity extends BaseActivity {
|
||||||
|
|
||||||
final FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
|
final FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
|
||||||
|
|
||||||
if(!isSelf && !blocking && !following) {
|
if(!isSelf && !blocking) {
|
||||||
floatingBtn.show();
|
floatingBtn.show();
|
||||||
|
|
||||||
|
if (following) {
|
||||||
|
floatingBtn.setImageResource(R.drawable.ic_person_minus_24px);
|
||||||
|
} else {
|
||||||
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
|
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
|
||||||
|
}
|
||||||
|
|
||||||
floatingBtn.setOnClickListener(new View.OnClickListener() {
|
floatingBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
follow(accountId);
|
follow(accountId);
|
||||||
floatingBtn.hide();
|
|
||||||
|
if (following) {
|
||||||
|
floatingBtn.setImageResource(R.drawable.ic_person_minus_24px);
|
||||||
|
} else {
|
||||||
|
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
12
app/src/main/res/drawable/ic_person_minus_24px.xml
Normal file
12
app/src/main/res/drawable/ic_person_minus_24px.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/toolbar_icon_dark"
|
||||||
|
android:pathData="M14.4,12c2.7,0.4,5-1.9,4.6-4.6c-0.3-1.7-1.6-3.1-3.3-3.3c-2.7-0.4-5,1.9-4.6,4.6C11.3,10.3,12.7,11.7,14.4,12z
|
||||||
|
M6,12h3v-2H6H4H1v2h3H6z M15,14c-2.7,0-8,1.3-8,4v2h16v-2C23,15.3,17.7,14,15,14z" />
|
||||||
|
</vector>
|
Loading…
Reference in a new issue