mirror of
https://github.com/xdsopl/robot36.git
synced 2026-02-28 00:54:19 +01:00
add margins to text pages
This commit is contained in:
parent
f8d6f6ff49
commit
066e200653
|
|
@ -27,8 +27,10 @@ import android.provider.MediaStore;
|
|||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
|
@ -620,9 +622,10 @@ public class MainActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void showTextPage(String message) {
|
||||
TextView view = new TextView(this);
|
||||
view.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||
view.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
View view = LayoutInflater.from(this).inflate(R.layout.text_page, null);
|
||||
TextView text = view.findViewById(R.id.message);
|
||||
text.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.Theme_AlertDialog);
|
||||
builder.setNeutralButton(R.string.close, null);
|
||||
builder.setView(view);
|
||||
|
|
|
|||
12
app/src/main/res/layout/text_page.xml
Normal file
12
app/src/main/res/layout/text_page.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in a new issue