Revert "Show if internet connectivity (experimental)"
This reverts commit ca65ab92a0
.
|
@ -138,6 +138,7 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
|
||||
|
|
|
@ -86,7 +86,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
private ImageView ivIcon;
|
||||
private ImageView ivQueue;
|
||||
private SwitchCompat swEnabled;
|
||||
private ImageView ivActive;
|
||||
private ImageView ivMetered;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
private AdapterRule adapter = null;
|
||||
|
@ -152,7 +151,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
ivIcon = (ImageView) actionView.findViewById(R.id.ivIcon);
|
||||
ivQueue = (ImageView) actionView.findViewById(R.id.ivQueue);
|
||||
swEnabled = (SwitchCompat) actionView.findViewById(R.id.swEnabled);
|
||||
ivActive = (ImageView) actionView.findViewById(R.id.ivActive);
|
||||
ivMetered = (ImageView) actionView.findViewById(R.id.ivMetered);
|
||||
|
||||
// Icon
|
||||
|
@ -241,23 +239,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
if (enabled)
|
||||
checkDoze();
|
||||
|
||||
// Network is active
|
||||
ivActive.setImageResource(Util.isActive(ActivityMain.this) ? R.drawable.ic_cloud_queue_white_24dp : R.drawable.ic_cloud_off_white_24dp);
|
||||
ivActive.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
int location[] = new int[2];
|
||||
actionView.getLocationOnScreen(location);
|
||||
Toast toast = Toast.makeText(ActivityMain.this, Util.isActive(ActivityMain.this) ? R.string.msg_active : R.string.msg_inactive, Toast.LENGTH_LONG);
|
||||
toast.setGravity(
|
||||
Gravity.TOP | Gravity.LEFT,
|
||||
location[0] + ivActive.getLeft(),
|
||||
Math.round(location[1] + ivActive.getBottom() - toast.getView().getPaddingTop()));
|
||||
toast.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Network is metered
|
||||
ivMetered.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
|
@ -627,8 +608,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
Log.i(TAG, "Received " + intent);
|
||||
Util.logExtras(intent);
|
||||
|
||||
if (adapter != null) {
|
||||
ivActive.setImageResource(Util.isActive(ActivityMain.this) ? R.drawable.ic_cloud_queue_white_24dp : R.drawable.ic_cloud_off_white_24dp);
|
||||
if (adapter != null)
|
||||
if (intent.hasExtra(EXTRA_CONNECTED) && intent.hasExtra(EXTRA_METERED)) {
|
||||
if (intent.getBooleanExtra(EXTRA_CONNECTED, false)) {
|
||||
if (intent.getBooleanExtra(EXTRA_METERED, false))
|
||||
|
@ -642,7 +622,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
}
|
||||
} else
|
||||
updateApplicationList(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -114,11 +114,6 @@ public class Util {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isActive(Context context) {
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
return (cm == null ? false : cm.getActiveNetworkInfo() != null);
|
||||
}
|
||||
|
||||
public static boolean isConnected(Context context) {
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo ni = (cm == null ? null : cm.getActiveNetworkInfo());
|
||||
|
|
Before Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 433 B |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 330 B |
Before Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 582 B |
Before Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 785 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1 KiB |
|
@ -30,14 +30,6 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:saveEnabled="false" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivActive"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginStart="16dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMetered"
|
||||
android:layout_width="24dp"
|
||||
|
|
|
@ -65,50 +65,6 @@
|
|||
android:textAppearance="@style/TextMedium" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="4dp"
|
||||
android:src="?attr/iconActive" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/msg_active"
|
||||
android:textAppearance="@style/TextMedium" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="4dp"
|
||||
android:src="?attr/iconInactive" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/msg_inactive"
|
||||
android:textAppearance="@style/TextMedium" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -197,8 +197,6 @@ Your internet traffic is not being sent to a remote VPN server.</string>
|
|||
<string name="msg_start_forward" formatted="false">Start forwarding from %1$s port %2$d to %3$s:%4$d of \'%5$s\'?</string>
|
||||
<string name="msg_stop_forward">Stop forwarding of %1$s port %2$d?</string>
|
||||
<string name="msg_metered">Network is metered</string>
|
||||
<string name="msg_active">Network is active</string>
|
||||
<string name="msg_inactive">Network is inactive</string>
|
||||
<string name="msg_queue">NetGuard is busy</string>
|
||||
<string name="msg_update">Update available, tap to download</string>
|
||||
<string name="msg_usage">You can allow (greenish) or deny (reddish) Wi-Fi or mobile internet access to by tapping on the icons next to an application</string>
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
<attr name="colorOff" format="reference" />
|
||||
<attr name="expander" format="reference" />
|
||||
<attr name="iconQueue" format="reference" />
|
||||
<attr name="iconActive" format="reference" />
|
||||
<attr name="iconInactive" format="reference" />
|
||||
<attr name="iconMetered" format="reference" />
|
||||
<attr name="iconSettings" format="reference" />
|
||||
<attr name="iconDatasaver" format="reference" />
|
||||
|
@ -21,8 +19,6 @@
|
|||
<style name="BaseThemeDark" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="expander">@drawable/expander_black</item>
|
||||
<item name="iconQueue">@drawable/ic_hourglass_empty_black_24dp</item>
|
||||
<item name="iconActive">@drawable/ic_cloud_queue_black_24dp</item>
|
||||
<item name="iconInactive">@drawable/ic_cloud_off_black_24dp</item>
|
||||
<item name="iconMetered">@drawable/ic_attach_money_black_24dp</item>
|
||||
<item name="iconSettings">@drawable/ic_settings_black_24dp</item>
|
||||
<item name="iconDatasaver">@drawable/ic_perm_data_setting_black_24dp</item>
|
||||
|
@ -36,8 +32,6 @@
|
|||
<style name="BaseThemeLight" parent="Theme.AppCompat">
|
||||
<item name="expander">@drawable/expander_white</item>
|
||||
<item name="iconQueue">@drawable/ic_hourglass_empty_white_24dp</item>
|
||||
<item name="iconActive">@drawable/ic_cloud_queue_white_24dp</item>
|
||||
<item name="iconInactive">@drawable/ic_cloud_off_white_24dp</item>
|
||||
<item name="iconMetered">@drawable/ic_attach_money_white_24dp</item>
|
||||
<item name="iconSettings">@drawable/ic_settings_white_24dp</item>
|
||||
<item name="iconDatasaver">@drawable/ic_perm_data_setting_white_24dp</item>
|
||||
|
|