Minor formatting/lint fixes/cleanup before CR.
This commit is contained in:
parent
cb0f252d74
commit
59c6e36034
@ -145,17 +145,17 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
|
||||
}
|
||||
|
||||
private void handleSearchOrAppViewIntent(Intent intent) {
|
||||
final Uri data = intent.getData();
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
|
||||
String query = intent.getStringExtra(SearchManager.QUERY);
|
||||
performSearch(query);
|
||||
return;
|
||||
}
|
||||
|
||||
final Uri data = intent.getData();
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String scheme = data.getScheme();
|
||||
final String path = data.getPath();
|
||||
String appId = null;
|
||||
@ -225,19 +225,15 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
|
||||
query = query.split(":")[1];
|
||||
}
|
||||
|
||||
Intent call = null;
|
||||
if (!TextUtils.isEmpty(appId)) {
|
||||
Utils.debugLog(TAG, "FDroid launched via app link for '" + appId + "'");
|
||||
call = new Intent(this, AppDetails.class);
|
||||
call.putExtra(AppDetails.EXTRA_APPID, appId);
|
||||
Intent intentToInvoke = new Intent(this, AppDetails.class);
|
||||
intentToInvoke.putExtra(AppDetails.EXTRA_APPID, appId);
|
||||
startActivity(intentToInvoke);
|
||||
} else if (!TextUtils.isEmpty(query)) {
|
||||
Utils.debugLog(TAG, "FDroid launched via search link for '" + query + "'");
|
||||
performSearch(query);
|
||||
}
|
||||
|
||||
if (call != null) {
|
||||
startActivity(call);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkForAddRepoIntent() {
|
||||
@ -285,6 +281,8 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
|
||||
searchView.setMaxWidth(1000000);
|
||||
searchView.setOnQueryTextListener(this);
|
||||
|
||||
// If we were asked to execute a search before getting around to building the options
|
||||
// menu, then we should deal with that now that the options menu is all sorted out.
|
||||
if (pendingSearchQuery != null) {
|
||||
performSearch(pendingSearchQuery);
|
||||
pendingSearchQuery = null;
|
||||
@ -376,8 +374,8 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
|
||||
|
||||
private void createViews() {
|
||||
viewPager = (ViewPager) findViewById(R.id.main_pager);
|
||||
this.adapter = new AppListFragmentPagerAdapter(this);
|
||||
viewPager.setAdapter(this.adapter);
|
||||
adapter = new AppListFragmentPagerAdapter(this);
|
||||
viewPager.setAdapter(adapter);
|
||||
viewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
@ -414,7 +412,7 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
adapter.updateSearchQuery(newText, getTabManager().getSelectedIndex());
|
||||
adapter.updateSearchQuery(newText);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,6 @@ public class TabManager {
|
||||
this.pager = pager;
|
||||
}
|
||||
|
||||
public int getSelectedIndex() {
|
||||
return actionBar != null ? actionBar.getSelectedNavigationIndex() : -1;
|
||||
}
|
||||
|
||||
protected CharSequence getLabel(int index) {
|
||||
return pager.getAdapter().getPageTitle(index);
|
||||
}
|
||||
|
@ -20,22 +20,13 @@ import org.fdroid.fdroid.views.fragments.InstalledAppsFragment;
|
||||
*/
|
||||
public class AppListFragmentPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
@NonNull
|
||||
private final FDroid parent;
|
||||
@NonNull private final FDroid parent;
|
||||
|
||||
@NonNull
|
||||
private final AppListFragment availableFragment;
|
||||
@NonNull private final AppListFragment availableFragment;
|
||||
@NonNull private final AppListFragment installedFragment;
|
||||
@NonNull private final AppListFragment canUpdateFragment;
|
||||
|
||||
@NonNull
|
||||
private final AppListFragment installedFragment;
|
||||
|
||||
@NonNull
|
||||
private final AppListFragment canUpdateFragment;
|
||||
|
||||
@Nullable
|
||||
private String searchQuery;
|
||||
|
||||
public AppListFragmentPagerAdapter(FDroid parent) {
|
||||
public AppListFragmentPagerAdapter(@NonNull FDroid parent) {
|
||||
super(parent.getSupportFragmentManager());
|
||||
this.parent = parent;
|
||||
|
||||
@ -54,8 +45,7 @@ public class AppListFragmentPagerAdapter extends FragmentPagerAdapter {
|
||||
return parent.getString(R.string.tab_updates_count, updateCount);
|
||||
}
|
||||
|
||||
public void updateSearchQuery(@Nullable String query, int tabIndex) {
|
||||
searchQuery = query;
|
||||
public void updateSearchQuery(@Nullable String query) {
|
||||
availableFragment.updateSearchQuery(query);
|
||||
installedFragment.updateSearchQuery(query);
|
||||
canUpdateFragment.updateSearchQuery(query);
|
||||
|
@ -54,8 +54,7 @@ public abstract class AppListFragment extends ListFragment implements
|
||||
|
||||
protected AppListAdapter appAdapter;
|
||||
|
||||
@Nullable
|
||||
private String searchQuery;
|
||||
@Nullable private String searchQuery;
|
||||
|
||||
protected abstract AppListAdapter getAppListAdapter();
|
||||
|
||||
@ -157,7 +156,7 @@ public abstract class AppListFragment extends ListFragment implements
|
||||
}
|
||||
|
||||
public void updateSearchQuery(@Nullable String query) {
|
||||
this.searchQuery = query;
|
||||
searchQuery = query;
|
||||
if (isAdded()) {
|
||||
getLoaderManager().restartLoader(0, null, this);
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "A helper script to send all of the various intents that F-droid should be able to handle via ADB."
|
||||
echo "Use this to ensure that things which should trigger searches, do trigger searches, and those which should bring up the app details screen, do bring it up."
|
||||
echo ""
|
||||
|
||||
function view {
|
||||
DESCRIPTION=$1
|
||||
DATA=$2
|
||||
|
Loading…
x
Reference in New Issue
Block a user