Skip to content

Commit 4aa0461

Browse files
committed
Updated to Build 170
1 parent 2b10d70 commit 4aa0461

File tree

20 files changed

+35
-4
lines changed

20 files changed

+35
-4
lines changed

app/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
1616

1717
<application
18-
android:allowBackup="true"
19-
android:icon="@drawable/icon"
18+
android:icon="@mipmap/ic_launcher"
19+
android:roundIcon="@mipmap/ic_launcher"
2020
android:label="@string/app_name"
2121
android:theme="@style/DarkTheme">
2222

app/src/main/java/com/truemlgpro/wifiinfo/ConnectionStateService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ConnectionStateService extends Service
1414
private BroadcastReceiver ConnectionStateReceiver;
1515
private Notification.Builder builder;
1616

17-
// Build 157
17+
// Build 170
1818

1919
public class ConnectionStateReceiver extends BroadcastReceiver
2020
{

app/src/main/java/com/truemlgpro/wifiinfo/MainActivity.java

+29-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import android.location.*;
2323
import android.provider.*;
2424
import android.Manifest;
25+
import android.graphics.drawable.*;
2526
import java.util.*;
2627
import java.net.*;
2728
import java.io.*;
@@ -62,12 +63,39 @@ protected void onCreate(Bundle savedInstanceState)
6263

6364
/// END ///
6465

66+
/// Create dynamic shortcuts ///
67+
68+
if (android.os.Build.VERSION.SDK_INT > 25) {
69+
70+
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
71+
72+
ShortcutInfo githubShortcut = new ShortcutInfo.Builder(this, "shortcut_github")
73+
.setShortLabel("GitHub Repo")
74+
.setLongLabel("Open GitHub repository")
75+
.setIcon(Icon.createWithResource(this, R.drawable.ic_github))
76+
.setRank(2)
77+
.setIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/TrueMLGPro/Wi-Fi_Info/")))
78+
.build();
79+
80+
ShortcutInfo releasesShortcut = new ShortcutInfo.Builder(this, "shortcut_releases")
81+
.setShortLabel("Releases")
82+
.setLongLabel("Open GitHub releases")
83+
.setRank(1)
84+
.setIcon(Icon.createWithResource(this, R.drawable.ic_folder))
85+
.setIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/TrueMLGPro/Wi-Fi_Info/releases")))
86+
.build();
87+
88+
shortcutManager.setDynamicShortcuts(Arrays.asList(githubShortcut, releasesShortcut));
89+
}
90+
91+
/// END ///
92+
6593
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
6694

6795
int Permission_All = 1;
6896
String[] Permissions = {Manifest.permission.ACCESS_FINE_LOCATION};
6997
if(!hasPermissions(this, Permissions)) {
70-
Toast toast = Toast.makeText(this, "Location permission is needed to show SSID and BSSID on Android 8+, grant it to get full info", Toast.LENGTH_LONG);
98+
Toast toast = Toast.makeText(this, "Location permission is needed to show SSID, BSSID and Network ID on Android 8+, grant it to get full info", Toast.LENGTH_LONG);
7199
toast.setGravity(Gravity.CENTER|Gravity.FILL_HORIZONTAL, 0, 50);
72100
toast.show();
73101

2.23 KB
Loading
3.17 KB
Loading
1.5 KB
Loading
1.85 KB
Loading
3.01 KB
Loading
3.85 KB
Loading
4.46 KB
Loading
6.58 KB
Loading
6.13 KB
Loading
7.86 KB
Loading

app/src/main/res/drawable/icon.png

-47.1 KB
Binary file not shown.
2.57 KB
Loading
1.38 KB
Loading
3.38 KB
Loading
5.93 KB
Loading
10.1 KB
Loading

app/src/main/res/values/strings.xml

+3
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
<resources>
33

44
<string name="app_name">Wi-Fi Info</string>
5+
<string name="shortcut_main_short">Start</string>
6+
<string name="shortcut_main_long">Start the main activity</string>
7+
<string name="shortcut_disabled">Shortcut is not available</string>
58

69
</resources>

0 commit comments

Comments
 (0)