-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa3ab60
commit ac8d213
Showing
47 changed files
with
1,167 additions
and
573 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
app/src/main/java/com/mugames/vidsnap/CircularProgressDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* This file is part of VidSnap. | ||
* | ||
* VidSnap is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* VidSnap is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with VidSnap. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package com.mugames.vidsnap; | ||
|
||
import static com.mugames.vidsnap.utility.Statics.TAG; | ||
|
||
import android.app.Activity; | ||
import android.app.AlertDialog; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.ProgressBar; | ||
import android.widget.TextView; | ||
|
||
public class CircularProgressDialog{ | ||
|
||
Activity activity; | ||
AlertDialog dialog; | ||
TextView progressText; | ||
TextView status; | ||
ProgressBar progressBar; | ||
int progress=0; | ||
String statusTxt=""; | ||
public CircularProgressDialog(Activity activity) { | ||
this.activity=activity; | ||
} | ||
|
||
|
||
public void show() { | ||
String text = progress+"%"; | ||
if (dialog == null) { | ||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity); | ||
View v = activity.getLayoutInflater().inflate(R.layout.circular_download_dialog, null); | ||
progressText = v.findViewById(R.id.progressValue); | ||
progressBar = v.findViewById(R.id.progressBar); | ||
status = v.findViewById(R.id.download_status); | ||
status.setText(statusTxt); | ||
progressText.setText(text); | ||
progressBar.setProgress(progress); | ||
dialogBuilder.setView(v); | ||
dialogBuilder.setCancelable(false); | ||
dialog = dialogBuilder.create(); | ||
dialog.show(); | ||
} | ||
else { | ||
progressText.setText(text); | ||
progressBar.setProgress(progress); | ||
status.setText(statusTxt); | ||
if(dialog!=null && !dialog.isShowing()) dialog.show(); | ||
} | ||
} | ||
|
||
public void setProgress(int progress) { | ||
this.progress = progress; | ||
show(); | ||
} | ||
|
||
public void setStatusTxt(String statusTxt) { | ||
this.statusTxt = statusTxt; | ||
show(); | ||
} | ||
|
||
public void dismiss(){ | ||
if(dialog!=null && dialog.isShowing()) { | ||
dialog.dismiss(); | ||
Log.e(TAG, "dismiss: called from circular" ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.