mirror of https://github.com/M66B/NetGuard.git
parent
48bafdcf00
commit
144b1e3a67
|
@ -26,6 +26,7 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
|
@ -136,9 +137,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
swEnabled = (SwitchCompat) actionView.findViewById(R.id.swEnabled);
|
||||
ivMetered = (ImageView) actionView.findViewById(R.id.ivMetered);
|
||||
|
||||
// Icon, no title
|
||||
getSupportActionBar().setTitle(null);
|
||||
|
||||
// Icon
|
||||
ivIcon.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
|
@ -147,6 +146,12 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
}
|
||||
});
|
||||
|
||||
// Title
|
||||
getSupportActionBar().setTitle(null);
|
||||
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
|
||||
== Configuration.SCREENLAYOUT_SIZE_LARGE)
|
||||
actionView.findViewById(R.id.tvTitle).setVisibility(View.VISIBLE);
|
||||
|
||||
// Netguard is busy
|
||||
ivQueue.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -21,6 +21,17 @@
|
|||
android:src="@drawable/ic_hourglass_empty_white_24dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="@style/TextLarge"
|
||||
android:visibility="gone" />
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/swEnabled"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
Loading…
Reference in New Issue