add fragment transitions for headlines
This commit is contained in:
parent
70056d68ac
commit
c3a80f1be4
0
org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java
Normal file → Executable file
0
org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java
Normal file → Executable file
@ -8,7 +8,6 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
@ -239,25 +238,13 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
}
|
||||
|
||||
public void onFeedSelected(Feed feed, final boolean selectedByUser) {
|
||||
//GlobalState.getInstance().m_loadedArticles.clear();
|
||||
//m_pullToRefreshAttacher.setRefreshing(true);
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager()
|
||||
.beginTransaction();
|
||||
|
||||
ft.replace(R.id.headlines_fragment, new LoadingFragment(), null);
|
||||
ft.commit();
|
||||
|
||||
final Feed fFeed = feed;
|
||||
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FragmentTransaction ft = getSupportFragmentManager()
|
||||
.beginTransaction();
|
||||
|
||||
HeadlinesFragment hf = new HeadlinesFragment();
|
||||
hf.initialize(fFeed);
|
||||
hf.initialize(feed);
|
||||
|
||||
ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES);
|
||||
|
||||
ft.commit();
|
||||
@ -269,9 +256,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
if (m_drawerLayout != null) {
|
||||
m_drawerLayout.closeDrawers();
|
||||
}
|
||||
}
|
||||
}, 10);
|
||||
|
||||
|
||||
Date date = new Date();
|
||||
|
||||
|
@ -152,15 +152,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
|
||||
Intent resultIntent = new Intent();
|
||||
//resultIntent.putParcelableArrayListExtra("articles", m_articles);
|
||||
resultIntent.putExtra("articles", (Parcelable)m_articles);
|
||||
resultIntent.putExtra("activeArticle", m_activeArticle);
|
||||
|
||||
setResult(Activity.RESULT_OK, resultIntent);
|
||||
|
||||
finish();
|
||||
onBackPressed();
|
||||
return true;
|
||||
default:
|
||||
Log.d(TAG, "onOptionsItemSelected, unhandled id=" + item.getItemId());
|
||||
|
@ -20,6 +20,8 @@ import android.support.v4.app.Fragment;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.text.Html;
|
||||
import android.transition.Fade;
|
||||
import android.transition.Transition;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
@ -274,6 +276,16 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
}
|
||||
}
|
||||
|
||||
public HeadlinesFragment() {
|
||||
super();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Transition fade = new Fade();
|
||||
|
||||
setEnterTransition(fade);
|
||||
setReenterTransition(fade);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v,
|
||||
|
Loading…
Reference in New Issue
Block a user