diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png index 6b0126e91..bab6de878 100644 Binary files a/app/src/main/ic_launcher-web.png and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java index 941168469..443fecd59 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java @@ -28,7 +28,6 @@ import android.support.design.widget.FloatingActionButton; import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import android.os.Bundle; -import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.ImageView; @@ -44,7 +43,6 @@ import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import com.mikepenz.materialdrawer.model.ProfileDrawerItem; import com.mikepenz.materialdrawer.model.SecondaryDrawerItem; import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; -import com.mikepenz.materialdrawer.model.interfaces.IProfile; import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader; import com.mikepenz.materialdrawer.util.DrawerImageLoader; import com.squareup.picasso.Picasso; @@ -61,8 +59,7 @@ public class MainActivity extends BaseActivity { private PendingIntent serviceAlarmIntent; private boolean notificationServiceEnabled; private String loggedInAccountId; - private String loggedInAccountUsername; - Stack pageHistory = new Stack(); + Stack pageHistory = new Stack<>(); private ViewPager viewPager; private AccountHeader headerResult; private Drawer drawer; @@ -129,9 +126,13 @@ public class MainActivity extends BaseActivity { long drawerItemIdentifier = drawerItem.getIdentifier(); if (drawerItemIdentifier == 0) { - Intent intent = new Intent(MainActivity.this, AccountActivity.class); - intent.putExtra("id", loggedInAccountId); - startActivity(intent); + if (loggedInAccountId != null) { + Intent intent = new Intent(MainActivity.this, AccountActivity.class); + intent.putExtra("id", loggedInAccountId); + startActivity(intent); + } else { + Log.e(TAG, "Logged-in account id was not obtained yet when profile was opened."); + } } else if (drawerItemIdentifier == 1) { Intent intent = new Intent(MainActivity.this, FavouritesActivity.class); startActivity(intent); @@ -233,13 +234,6 @@ public class MainActivity extends BaseActivity { SharedPreferences preferences = getSharedPreferences( getString(R.string.preferences_file_key), Context.MODE_PRIVATE); final String domain = preferences.getString("domain", null); - String id = preferences.getString("loggedInAccountId", null); - String username = preferences.getString("loggedInAccountUsername", null); - - if (id != null && username != null) { - loggedInAccountId = id; - loggedInAccountUsername = username; - } mastodonAPI.accountVerifyCredentials().enqueue(new Callback() { @Override @@ -261,7 +255,7 @@ public class MainActivity extends BaseActivity { .withIcon(me.avatar) ); - //onFetchUserInfoSuccess(response.body().id, response.body().username); + loggedInAccountId = me.id; } @Override @@ -271,17 +265,6 @@ public class MainActivity extends BaseActivity { }); } - private void onFetchUserInfoSuccess(String id, String username) { - loggedInAccountId = id; - loggedInAccountUsername = username; - SharedPreferences preferences = getSharedPreferences( - getString(R.string.preferences_file_key), Context.MODE_PRIVATE); - SharedPreferences.Editor editor = preferences.edit(); - editor.putString("loggedInAccountId", loggedInAccountId); - editor.putString("loggedInAccountUsername", loggedInAccountUsername); - editor.apply(); - } - private void onFetchUserInfoFailure(Exception exception) { Log.e(TAG, "Failed to fetch user info. " + exception.getMessage()); } diff --git a/app/src/main/java/com/keylesspalace/tusky/SFragment.java b/app/src/main/java/com/keylesspalace/tusky/SFragment.java index 033445b95..d1de088ed 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/SFragment.java @@ -45,8 +45,6 @@ import retrofit2.Callback; * overlap functionality. So, I'm momentarily leaving it and hopefully working on those will clear * up what needs to be where. */ public class SFragment extends Fragment { - protected String domain; - protected String accessToken; protected String loggedInAccountId; protected String loggedInUsername; private MastodonAPI api; @@ -57,8 +55,6 @@ public class SFragment extends Fragment { SharedPreferences preferences = getContext().getSharedPreferences( getString(R.string.preferences_file_key), Context.MODE_PRIVATE); - domain = preferences.getString("domain", null); - accessToken = preferences.getString("accessToken", null); loggedInAccountId = preferences.getString("loggedInAccountId", null); loggedInUsername = preferences.getString("loggedInAccountUsername", null); api = ((BaseActivity) getActivity()).mastodonAPI; @@ -128,20 +124,6 @@ public class SFragment extends Fragment { } } - protected void follow(String id) { - api.followAccount(id).enqueue(new Callback() { - @Override - public void onResponse(Call call, retrofit2.Response response) { - - } - - @Override - public void onFailure(Call call, Throwable t) { - - } - }); - } - private void block(String id) { api.blockAccount(id).enqueue(new Callback() { @Override diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 8bdc44597..dfa09c1c4 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 52603b698..572b024fe 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 88090fec8..7e29b375d 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 3b5fa2c88..a74a37ebb 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 94bd03d73..c87ee57a7 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ