mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-12 19:27:12 +01:00
Cancel loading the user's info when there is nobody logging in. Delete a line which access a deleted string resource in manifest.
This commit is contained in:
parent
f2eb18749c
commit
b0e2e273a7
@ -44,7 +44,6 @@
|
|||||||
android:parentActivityName=".MainActivity" />
|
android:parentActivityName=".MainActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ViewSubredditDetailActivity"
|
android:name=".ViewSubredditDetailActivity"
|
||||||
android:label="@string/title_activity_view_subreddit_detail"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:parentActivityName=".MainActivity" />
|
android:parentActivityName=".MainActivity" />
|
||||||
</application>
|
</application>
|
||||||
|
@ -69,6 +69,20 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
drawer.addDrawerListener(toggle);
|
drawer.addDrawerListener(toggle);
|
||||||
toggle.syncState();
|
toggle.syncState();
|
||||||
|
|
||||||
|
String accessToken = getSharedPreferences(SharedPreferencesUtils.AUTH_CODE_FILE_KEY, Context.MODE_PRIVATE).getString(SharedPreferencesUtils.ACCESS_TOKEN_KEY, "");
|
||||||
|
if(accessToken.equals("")) {
|
||||||
|
Intent loginIntent = new Intent(this, LoginActivity.class);
|
||||||
|
startActivity(loginIntent);
|
||||||
|
} else {
|
||||||
|
if(savedInstanceState == null) {
|
||||||
|
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
||||||
|
mFragment = new BestPostFragment();
|
||||||
|
fragmentTransaction.replace(R.id.frame_layout_content_main, mFragment).commit();
|
||||||
|
} else {
|
||||||
|
mFragment = getFragmentManager().getFragment(savedInstanceState, "outStateFragment");
|
||||||
|
getFragmentManager().beginTransaction().replace(R.id.frame_layout_content_main, mFragment).commit();
|
||||||
|
}
|
||||||
|
|
||||||
Calendar now = Calendar.getInstance();
|
Calendar now = Calendar.getInstance();
|
||||||
Calendar queryAccessTokenTime = Calendar.getInstance();
|
Calendar queryAccessTokenTime = Calendar.getInstance();
|
||||||
queryAccessTokenTime.setTimeInMillis(getSharedPreferences(SharedPreferencesUtils.AUTH_CODE_FILE_KEY, Context.MODE_PRIVATE)
|
queryAccessTokenTime.setTimeInMillis(getSharedPreferences(SharedPreferencesUtils.AUTH_CODE_FILE_KEY, Context.MODE_PRIVATE)
|
||||||
@ -119,21 +133,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
glide.load(mBannerImageUrl).into(mBannerImageView);
|
glide.load(mBannerImageUrl).into(mBannerImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
String accessToken = getSharedPreferences(SharedPreferencesUtils.AUTH_CODE_FILE_KEY, Context.MODE_PRIVATE).getString(SharedPreferencesUtils.ACCESS_TOKEN_KEY, "");
|
|
||||||
if(accessToken.equals("")) {
|
|
||||||
Intent loginIntent = new Intent(this, LoginActivity.class);
|
|
||||||
startActivity(loginIntent);
|
|
||||||
} else {
|
|
||||||
if(savedInstanceState == null) {
|
|
||||||
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
|
||||||
mFragment = new BestPostFragment();
|
|
||||||
fragmentTransaction.replace(R.id.frame_layout_content_main, mFragment).commit();
|
|
||||||
} else {
|
|
||||||
mFragment = getFragmentManager().getFragment(savedInstanceState, "outStateFragment");
|
|
||||||
getFragmentManager().beginTransaction().replace(R.id.frame_layout_content_main, mFragment).commit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(savedInstanceState == null && !mFetchUserInfoSuccess) {
|
if(savedInstanceState == null && !mFetchUserInfoSuccess) {
|
||||||
new FetchUserInfo(this, Volley.newRequestQueue(this)).queryUserInfo(new FetchUserInfo.FetchUserInfoListener() {
|
new FetchUserInfo(this, Volley.newRequestQueue(this)).queryUserInfo(new FetchUserInfo.FetchUserInfoListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -240,6 +239,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
Loading…
Reference in New Issue
Block a user