mirror of
https://github.com/accelforce/Yuito
synced 2024-12-22 05:19:05 +01:00
changed AccountActivity so that it shows FAB that allows a user to un/follow a user from it instead of the menu
added an xml svg for unfollowing someone removed the useless line from build.gradle that I added in the last pull
This commit is contained in:
parent
19e1746049
commit
7a5e5dca7e
@ -44,7 +44,6 @@ dependencies {
|
||||
compile 'com.jakewharton:butterknife:8.4.0'
|
||||
compile 'com.google.firebase:firebase-messaging: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'
|
||||
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);
|
||||
|
||||
if(!isSelf && !blocking && !following) {
|
||||
if(!isSelf && !blocking) {
|
||||
floatingBtn.show();
|
||||
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
|
||||
|
||||
if (following) {
|
||||
floatingBtn.setImageResource(R.drawable.ic_person_minus_24px);
|
||||
} else {
|
||||
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
|
||||
}
|
||||
|
||||
floatingBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
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 New Issue
Block a user