-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Replace manual input button by dialog that show available provi…
…ders logs
- Loading branch information
1 parent
fd14d01
commit 6599b5e
Showing
11 changed files
with
84 additions
and
45 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
enioka_scan/src/main/java/com/enioka/scanner/activities/ManualLogDialog.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,29 @@ | ||
package com.enioka.scanner.activities; | ||
|
||
import android.content.Context; | ||
import android.graphics.PorterDuff; | ||
import android.graphics.PorterDuffColorFilter; | ||
import android.graphics.drawable.Drawable; | ||
|
||
import androidx.core.content.ContextCompat; | ||
|
||
import com.enioka.scanner.R; | ||
import com.google.android.material.dialog.MaterialAlertDialogBuilder; | ||
|
||
public class ManualLogDialog { | ||
void launchDialog(Context context, String title, String logs, String textButton) { | ||
Drawable icon = ContextCompat.getDrawable(context, R.drawable.info); | ||
|
||
if (icon != null) { | ||
// set color of icon to black api 18 | ||
icon.setColorFilter(new PorterDuffColorFilter(ContextCompat.getColor(context, com.google.android.material.R.color.design_default_color_primary), PorterDuff.Mode.SRC_IN)); | ||
} | ||
|
||
new MaterialAlertDialogBuilder(context) | ||
.setTitle(title) | ||
.setIcon(icon) | ||
.setMessage(logs) | ||
.setNegativeButton(textButton, (dialog, which) -> dialog.dismiss()) | ||
.show(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="16dp" | ||
android:height="16dp" | ||
android:viewportWidth="16" | ||
android:viewportHeight="16"> | ||
<path | ||
android:pathData="M12.736,3.97a0.733,0.733 0,0 1,1.047 0c0.286,0.289 0.29,0.756 0.01,1.05L7.88,12.01a0.733,0.733 0,0 1,-1.065 0.02L3.217,8.384a0.757,0.757 0,0 1,0 -1.06,0.733 0.733,0 0,1 1.047,0l3.052,3.093 5.4,-6.425z" | ||
android:fillColor="@android:color/white"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="16dp" | ||
android:height="16dp" | ||
android:viewportWidth="16" | ||
android:viewportHeight="16"> | ||
<path | ||
android:pathData="M8,16A8,8 0,1 0,8 0a8,8 0,0 0,0 16m0.93,-9.412 l-1,4.705c-0.07,0.34 0.029,0.533 0.304,0.533 0.194,0 0.487,-0.07 0.686,-0.246l-0.088,0.416c-0.287,0.346 -0.92,0.598 -1.465,0.598 -0.703,0 -1.002,-0.422 -0.808,-1.319l0.738,-3.468c0.064,-0.293 0.006,-0.399 -0.287,-0.47l-0.451,-0.081 0.082,-0.381 2.29,-0.287zM8,5.5a1,1 0,1 1,0 -2,1 1,0 0,1 0,2" | ||
android:fillColor="@android:color/white"/> | ||
</vector> |
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
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