Merge branch 'feature/return-to-search-on-up' into 'master'
Return to SearchResults on "Up" navigation from AppDetails When arriving to the AppDetails screen from SearchResults, the Up navigation should return to SearchResults screen and not its actual parent. Not only is this behavior intuitive, it is a commonly accepted UX paradigm on the platform. See merge request !147
This commit is contained in:
commit
d911aa2424
@ -129,6 +129,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
||||
|
||||
public static final String EXTRA_APPID = "appid";
|
||||
public static final String EXTRA_FROM = "from";
|
||||
public static final String EXTRA_HINT_SEARCHING = "searching";
|
||||
|
||||
private FDroidApp fdroidApp;
|
||||
private ApkListAdapter adapter;
|
||||
@ -769,7 +770,11 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
||||
switch (item.getItemId()) {
|
||||
|
||||
case android.R.id.home:
|
||||
navigateUp();
|
||||
if (getIntent().hasExtra(EXTRA_HINT_SEARCHING)) {
|
||||
finish();
|
||||
} else {
|
||||
navigateUp();
|
||||
}
|
||||
return true;
|
||||
|
||||
case LAUNCH:
|
||||
|
@ -111,6 +111,7 @@ public class SearchResultsFragment extends ListFragment implements LoaderManager
|
||||
|
||||
Intent intent = new Intent(getActivity(), AppDetails.class);
|
||||
intent.putExtra(AppDetails.EXTRA_APPID, app.id);
|
||||
intent.putExtra(AppDetails.EXTRA_HINT_SEARCHING, true);
|
||||
startActivityForResult(intent, REQUEST_APPDETAILS);
|
||||
super.onListItemClick(l, v, position, id);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user