Fix about view when logs collect is disabled
This commit is contained in:
parent
6360526c8d
commit
dcf05629b2
2 changed files with 57 additions and 49 deletions
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@drawable/background"
|
android:background="@drawable/background"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
|
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
|
||||||
|
|
||||||
|
@ -29,46 +29,51 @@
|
||||||
|
|
||||||
<View android:layout_weight="50" android:layout_width="0dp" android:layout_height="0dp" />
|
<View android:layout_weight="50" android:layout_width="0dp" android:layout_height="0dp" />
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/about_text"
|
android:text="@string/about_text"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_contrast"
|
android:textColor="@color/text_contrast"
|
||||||
android:id="@+id/AboutText"/>
|
android:id="@+id/AboutText"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/about_link"
|
android:text="@string/about_link"
|
||||||
android:autoLink="web"
|
android:autoLink="web"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_contrast"
|
android:textColor="@color/text_contrast"
|
||||||
android:id="@+id/AboutLink"/>
|
android:id="@+id/AboutLink"/>
|
||||||
|
|
||||||
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
|
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:gravity="center"
|
android:gravity="center_horizontal"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<View android:layout_weight="1" android:layout_width="0dp" android:layout_height="0dp" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/send_log"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/menu_send_log"/>
|
|
||||||
<View android:layout_weight="1" android:layout_width="0dp" android:layout_height="0dp" />
|
|
||||||
<Button android:id="@+id/exit"
|
|
||||||
android:layout_toRightOf="@id/send_log"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/menu_exit"
|
|
||||||
android:visibility="visible"/>
|
|
||||||
<View android:layout_weight="1" android:layout_width="0dp" android:layout_height="0dp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/send_log_layout"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/send_log"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_send_log"/>
|
||||||
|
<View android:layout_width="50dp" android:layout_height="0dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<Button android:id="@+id/exit"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_toRightOf="@id/send_log_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/menu_exit"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
|
<View android:layout_weight="30" android:layout_width="0dp" android:layout_height="0dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -27,6 +27,7 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,48 +37,50 @@ public class AboutFragment extends Fragment implements OnClickListener {
|
||||||
private FragmentsAvailable about = FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT;
|
private FragmentsAvailable about = FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT;
|
||||||
View exitButton = null;
|
View exitButton = null;
|
||||||
View sendLogButton = null;
|
View sendLogButton = null;
|
||||||
|
LinearLayout sendLogLayout = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
if (getArguments() != null && getArguments().getSerializable("About") != null) {
|
if (getArguments() != null && getArguments().getSerializable("About") != null) {
|
||||||
about = (FragmentsAvailable) getArguments().getSerializable("About");
|
about = (FragmentsAvailable) getArguments().getSerializable("About");
|
||||||
}
|
}
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.about, container, false);
|
View view = inflater.inflate(R.layout.about, container, false);
|
||||||
|
|
||||||
TextView aboutText = (TextView) view.findViewById(R.id.AboutText);
|
TextView aboutText = (TextView) view.findViewById(R.id.AboutText);
|
||||||
try {
|
try {
|
||||||
aboutText.setText(String.format(getString(R.string.about_text), getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName));
|
aboutText.setText(String.format(getString(R.string.about_text), getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName));
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
Log.e(e, "cannot get version name");
|
Log.e(e, "cannot get version name");
|
||||||
}
|
}
|
||||||
|
|
||||||
sendLogButton = view.findViewById(R.id.send_log);
|
sendLogButton = view.findViewById(R.id.send_log);
|
||||||
sendLogButton.setOnClickListener(this);
|
sendLogButton.setOnClickListener(this);
|
||||||
sendLogButton.setVisibility(getResources().getBoolean(R.bool.enable_log_collect) ? View.VISIBLE : View.GONE);
|
sendLogLayout = (LinearLayout)view.findViewById(R.id.send_log_layout);
|
||||||
|
sendLogLayout.setVisibility(getResources().getBoolean(R.bool.enable_log_collect) ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
exitButton = view.findViewById(R.id.exit);
|
exitButton = view.findViewById(R.id.exit);
|
||||||
exitButton.setOnClickListener(this);
|
exitButton.setOnClickListener(this);
|
||||||
exitButton.setVisibility(View.VISIBLE);
|
exitButton.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
LinphoneActivity.instance().selectMenu(about);
|
LinphoneActivity.instance().selectMenu(about);
|
||||||
|
|
||||||
if (getResources().getBoolean(R.bool.show_statusbar_only_on_dialer)) {
|
if (getResources().getBoolean(R.bool.show_statusbar_only_on_dialer)) {
|
||||||
LinphoneActivity.instance().hideStatusBar();
|
LinphoneActivity.instance().hideStatusBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
|
|
Loading…
Reference in a new issue