Fixed display issue for the assistant welcome buttons some have a shadow below, some don't

This commit is contained in:
Sylvain Berfini 2019-04-16 17:43:36 +02:00
parent 335c677c7f
commit df4ede7d97
4 changed files with 41 additions and 24 deletions

View file

@ -24,11 +24,11 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import org.linphone.R;
public class WelcomeFragment extends Fragment implements OnClickListener {
private Button mCreateAccount, mLogLinphoneAccount, mLogGenericAccount, mRemoteProvisioning;
private TextView mCreateAccount, mLogLinphoneAccount, mLogGenericAccount, mRemoteProvisioning;
@Override
public View onCreateView(

View file

@ -78,8 +78,6 @@ public class NetworkSettingsFragment extends Fragment {
mIpv6 = mRootView.findViewById(R.id.pref_ipv6);
mPush = mRootView.findViewById(R.id.pref_push_notification);
mPush.setVisibility(
PushNotificationUtils.isAvailable(getActivity()) ? View.VISIBLE : View.GONE);
mRandomPorts = mRootView.findViewById(R.id.pref_transport_use_random_ports);
@ -101,10 +99,6 @@ public class NetworkSettingsFragment extends Fragment {
mAndroidBatterySaverSettings =
mRootView.findViewById(R.id.pref_android_battery_protected_settings);
mAndroidBatterySaverSettings.setVisibility(
DeviceUtils.hasDevicePowerManager(LinphoneActivity.instance())
? View.VISIBLE
: View.GONE);
}
protected void setListeners() {
@ -227,6 +221,8 @@ public class NetworkSettingsFragment extends Fragment {
mIpv6.setChecked(mPrefs.isUsingIpv6());
mPush.setChecked(mPrefs.isPushNotificationEnabled());
mPush.setVisibility(
PushNotificationUtils.isAvailable(getActivity()) ? View.VISIBLE : View.GONE);
mRandomPorts.setChecked(mPrefs.isUsingRandomPort());
@ -245,6 +241,11 @@ public class NetworkSettingsFragment extends Fragment {
mTurnUsername.setEnabled(mPrefs.isTurnEnabled());
mTurnPassword.setEnabled(mPrefs.isTurnEnabled());
mAndroidBatterySaverSettings.setVisibility(
DeviceUtils.hasDevicePowerManager(LinphoneActivity.instance())
? View.VISIBLE
: View.GONE);
setListeners();
}
}

View file

@ -37,26 +37,30 @@
android:layout_weight="1"
android:gravity="center">
<Button
<TextView
android:id="@+id/create_account"
style="@style/button_font"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_create_account"
android:text="@string/assistant_create_account" />
<Button
<TextView
android:id="@+id/login_linphone"
style="@style/button_font"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_weight="1"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_login_linphone"
android:text="@string/assistant_login_linphone" />
</TableRow>
@ -66,26 +70,30 @@
android:layout_weight="1"
android:gravity="center">
<Button
<TextView
android:id="@+id/login_generic"
style="@style/button_font"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_login_generic"
android:text="@string/assistant_login_generic" />
<Button
<TextView
android:id="@+id/remote_provisioning"
style="@style/button_font"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_weight="1"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_remote_provisioning"
android:text="@string/assistant_remote_provisioning" />

View file

@ -35,47 +35,55 @@
android:gravity="center"
android:orientation="vertical">
<Button
<TextView
android:id="@+id/create_account"
style="@style/button_font"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_create_account"
android:text="@string/assistant_create_account" />
<Button
<TextView
android:id="@+id/login_linphone"
style="@style/button_font"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_login_linphone"
android:text="@string/assistant_login_linphone" />
<Button
<TextView
android:id="@+id/login_generic"
style="@style/button_font"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_login_generic"
android:text="@string/assistant_login_generic" />
<Button
<TextView
android:id="@+id/remote_provisioning"
style="@style/button_font"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:background="@drawable/assistant_button"
android:textColor="@drawable/assistant_button_text_color"
android:gravity="center"
android:padding="10dp"
android:contentDescription="@string/assistant_remote_provisioning"
android:text="@string/assistant_remote_provisioning" />