mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)
This commit is contained in:
parent
20f74a90c4
commit
70851fa155
3 changed files with 31 additions and 15 deletions
|
|
@ -196,16 +196,38 @@ public class BookmarkListRootFragment extends CommonsDaggerSupportFragment imple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void backPressed() {
|
public boolean backPressed() {
|
||||||
if (null != mediaDetails && mediaDetails.isVisible()) {
|
//check mediaDetailPage fragment is not null then we check mediaDetail.is Visible or not to avoid NullPointerException
|
||||||
// todo add get list fragment
|
if(mediaDetails!=null) {
|
||||||
((BookmarkFragment) getParentFragment()).tabLayout.setVisibility(View.VISIBLE);
|
if (mediaDetails.isVisible()) {
|
||||||
removeFragment(mediaDetails);
|
if(mediaDetails.backButtonClicked()) {
|
||||||
setFragment(listFragment, mediaDetails);
|
// mediaDetails handled the back clicked , no further action required.
|
||||||
} else {
|
return true;
|
||||||
((MainActivity) getActivity()).setSelectedItemId(NavTab.CONTRIBUTIONS.code());
|
|
||||||
}
|
}
|
||||||
|
// todo add get list fragment
|
||||||
|
((BookmarkFragment) getParentFragment()).setupTabLayout();
|
||||||
|
ArrayList<Integer> removed=mediaDetails.getRemovedItems();
|
||||||
|
removeFragment(mediaDetails);
|
||||||
|
((BookmarkFragment) getParentFragment()).setScroll(true);
|
||||||
|
setFragment(listFragment, mediaDetails);
|
||||||
((MainActivity) getActivity()).showTabs();
|
((MainActivity) getActivity()).showTabs();
|
||||||
|
if(listFragment instanceof BookmarkPicturesFragment){
|
||||||
|
GridViewAdapter adapter=((GridViewAdapter)((BookmarkPicturesFragment)listFragment).getAdapter());
|
||||||
|
Iterator i = removed.iterator();
|
||||||
|
while (i.hasNext()) {
|
||||||
|
adapter.remove(adapter.getItem((int)i.next()));
|
||||||
|
}
|
||||||
|
mediaDetails.clearRemoved();
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
moveToContributionsFragment();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
moveToContributionsFragment();
|
||||||
|
}
|
||||||
|
// notify mediaDetails did not handled the backPressed further actions required.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void moveToContributionsFragment(){
|
void moveToContributionsFragment(){
|
||||||
|
|
|
||||||
|
|
@ -339,12 +339,6 @@ public class ContributionsFragment
|
||||||
getChildFragmentManager().executePendingTransactions();
|
getChildFragmentManager().executePendingTransactions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Intent getUploadServiceIntent(){
|
|
||||||
Intent intent = new Intent(getActivity(), UploadService.class);
|
|
||||||
intent.setAction(UploadService.ACTION_START_SERVICE);
|
|
||||||
return intent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
private void setUploadCount() {
|
private void setUploadCount() {
|
||||||
compositeDisposable.add(okHttpJsonApiClient
|
compositeDisposable.add(okHttpJsonApiClient
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,9 @@ class NearbyResultItem(private val item: ResultTuple?,
|
||||||
|
|
||||||
fun getDescription(): ResultTuple {
|
fun getDescription(): ResultTuple {
|
||||||
return description ?: ResultTuple()
|
return description ?: ResultTuple()
|
||||||
|
}
|
||||||
|
|
||||||
fun getEndTime(): ResultTuple {
|
fun getEndTime(): ResultTuple {
|
||||||
return endTime ?: ResultTuple()
|
return endTime ?: ResultTuple()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue