mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Changed progress in progress activity
This commit is contained in:
parent
64ad6ca94b
commit
a01263a6e8
4 changed files with 8 additions and 27 deletions
|
|
@ -137,7 +137,6 @@ class FailedUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCont
|
||||||
|
|
||||||
fun restartUploads() {
|
fun restartUploads() {
|
||||||
if (contributionsList != null) {
|
if (contributionsList != null) {
|
||||||
uploadProgressActivity.resetProgressBar()
|
|
||||||
pendingUploadsPresenter.restartUploads(
|
pendingUploadsPresenter.restartUploads(
|
||||||
contributionsList,
|
contributionsList,
|
||||||
0,
|
0,
|
||||||
|
|
@ -148,7 +147,6 @@ class FailedUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCont
|
||||||
|
|
||||||
override fun restartUpload(index: Int) {
|
override fun restartUpload(index: Int) {
|
||||||
if (contributionsList != null) {
|
if (contributionsList != null) {
|
||||||
uploadProgressActivity.resetProgressBar()
|
|
||||||
pendingUploadsPresenter.restartUpload(
|
pendingUploadsPresenter.restartUpload(
|
||||||
contributionsList,
|
contributionsList,
|
||||||
index,
|
index,
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ class PendingUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCon
|
||||||
|
|
||||||
private var contributionsSize = 0
|
private var contributionsSize = 0
|
||||||
var contributionsList = ArrayList<Contribution>()
|
var contributionsList = ArrayList<Contribution>()
|
||||||
private var totalUploads = 0
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
@ -135,10 +134,6 @@ class PendingUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCon
|
||||||
binding.pendingUplaodsLl.visibility = View.GONE
|
binding.pendingUplaodsLl.visibility = View.GONE
|
||||||
uploadProgressActivity.hidePendingIcons()
|
uploadProgressActivity.hidePendingIcons()
|
||||||
} else {
|
} else {
|
||||||
if (totalUploads == 0) {
|
|
||||||
totalUploads = contributionsSize
|
|
||||||
binding.progressBarPending.max = totalUploads
|
|
||||||
}
|
|
||||||
binding.nopendingTextView.visibility = View.GONE
|
binding.nopendingTextView.visibility = View.GONE
|
||||||
binding.pendingUplaodsLl.visibility = View.VISIBLE
|
binding.pendingUplaodsLl.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
|
@ -188,8 +183,7 @@ class PendingUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCon
|
||||||
|
|
||||||
adapter.submitList(pagedList)
|
adapter.submitList(pagedList)
|
||||||
|
|
||||||
binding.progressTextView.setText((totalUploads - contributionsSize).toString() + "/" + totalUploads + " uploaded")
|
binding.progressTextView.setText(contributionsSize.toString() + " uploads left")
|
||||||
binding.progressBarPending.progress = totalUploads - contributionsSize
|
|
||||||
if (pausedOrQueuedUploads == contributionsSize) {
|
if (pausedOrQueuedUploads == contributionsSize) {
|
||||||
uploadProgressActivity.setPausedIcon(true)
|
uploadProgressActivity.setPausedIcon(true)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -218,7 +212,6 @@ class PendingUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCon
|
||||||
contribution,
|
contribution,
|
||||||
this.requireContext().applicationContext
|
this.requireContext().applicationContext
|
||||||
)
|
)
|
||||||
resetProgressBar()
|
|
||||||
},
|
},
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
|
|
@ -282,8 +275,4 @@ class PendingUploadsFragment : CommonsDaggerSupportFragment(), PendingUploadsCon
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun resetProgressBar() {
|
|
||||||
totalUploads = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -191,8 +191,4 @@ class UploadProgressActivity : BaseActivity() {
|
||||||
updateMenuItems(binding.uploadProgressViewPager.currentItem)
|
updateMenuItems(binding.uploadProgressViewPager.currentItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun resetProgressBar(){
|
|
||||||
pendingUploadsFragment!!.resetProgressBar()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,15 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="You do not have any pending Uploads!" />
|
android:text="You do not have any pending Uploads!"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/pendingUplaodsLl"
|
android:id="@+id/pendingUplaodsLl"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -39,19 +40,16 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/progress_text_view"
|
android:id="@+id/progress_text_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="0/2 uploaded" />
|
android:gravity="right"
|
||||||
|
android:text=""
|
||||||
<ProgressBar
|
android:textSize="21sp" />
|
||||||
android:id="@+id/progressBarPending"
|
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue