mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fix Multi-Upload Wizard only asks Metadata for one picture (#5478)
* Fix Multi-Upload Wizard only asks Metadata for one picture * javadoc * typo --------- Co-authored-by: shashankkumar <shashankkumar45556@gmail.com> Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
5225f3e7f2
commit
8789879f10
1 changed files with 11 additions and 5 deletions
|
|
@ -167,6 +167,11 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
|
||||||
*/
|
*/
|
||||||
private boolean showPermissionsDialog = true;
|
private boolean showPermissionsDialog = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether fragments have been saved.
|
||||||
|
*/
|
||||||
|
private boolean isFragmentsSaved = false;
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -179,6 +184,7 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
|
||||||
created by the system and populate the fragments ArrayList
|
created by the system and populate the fragments ArrayList
|
||||||
*/
|
*/
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
isFragmentsSaved = true;
|
||||||
List<Fragment> fragmentList = getSupportFragmentManager().getFragments();
|
List<Fragment> fragmentList = getSupportFragmentManager().getFragments();
|
||||||
fragments = new ArrayList<>();
|
fragments = new ArrayList<>();
|
||||||
for (Fragment fragment : fragmentList) {
|
for (Fragment fragment : fragmentList) {
|
||||||
|
|
@ -597,18 +603,18 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(fragments.size()==0){
|
if(isFragmentsSaved){
|
||||||
|
UploadMediaDetailFragment fragment = (UploadMediaDetailFragment) fragments.get(0);
|
||||||
|
fragment.setCallback(uploadMediaDetailFragmentCallback);
|
||||||
|
}else{
|
||||||
uploadMediaDetailFragment.setCallback(uploadMediaDetailFragmentCallback);
|
uploadMediaDetailFragment.setCallback(uploadMediaDetailFragmentCallback);
|
||||||
fragments.add(uploadMediaDetailFragment);
|
fragments.add(uploadMediaDetailFragment);
|
||||||
}else{
|
|
||||||
UploadMediaDetailFragment fragment = (UploadMediaDetailFragment) fragments.get(0);
|
|
||||||
fragment.setCallback(uploadMediaDetailFragmentCallback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//If fragments are not created, create them and add them to the fragments ArrayList
|
//If fragments are not created, create them and add them to the fragments ArrayList
|
||||||
if(!(fragments.size()>1)){
|
if(!isFragmentsSaved){
|
||||||
uploadCategoriesFragment = new UploadCategoriesFragment();
|
uploadCategoriesFragment = new UploadCategoriesFragment();
|
||||||
if (place != null) {
|
if (place != null) {
|
||||||
Bundle categoryBundle = new Bundle();
|
Bundle categoryBundle = new Bundle();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue