1 |
efrain |
1 |
package com.cesams.twogetskills.activity;
|
|
|
2 |
|
|
|
3 |
import android.content.Intent;
|
|
|
4 |
import android.os.Build;
|
|
|
5 |
import android.os.Bundle;
|
|
|
6 |
import android.text.Html;
|
|
|
7 |
|
|
|
8 |
import androidx.appcompat.app.AppCompatActivity;
|
|
|
9 |
|
|
|
10 |
import com.cesams.twogetskills.Constants;
|
|
|
11 |
import com.cesams.twogetskills.R;
|
|
|
12 |
import com.codesgood.views.JustifiedTextView;
|
|
|
13 |
|
|
|
14 |
public class TextActivity extends AppCompatActivity {
|
|
|
15 |
|
|
|
16 |
private JustifiedTextView textView;
|
|
|
17 |
|
|
|
18 |
@Override
|
|
|
19 |
protected void onCreate(Bundle savedInstanceState) {
|
|
|
20 |
super.onCreate(savedInstanceState);
|
|
|
21 |
setContentView(R.layout.activity_text);
|
|
|
22 |
|
|
|
23 |
String description = getIntent().getStringExtra("description");
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
textView = (JustifiedTextView) findViewById(R.id.activity_text);
|
|
|
27 |
//textView.setText(description);
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
|
31 |
textView.setText("" + Html.fromHtml(description, Html.FROM_HTML_MODE_COMPACT));
|
|
|
32 |
} else {
|
|
|
33 |
textView.setText("" + Html.fromHtml(description));
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
@Override
|
|
|
40 |
public void onBackPressed() {
|
|
|
41 |
Intent intent = new Intent();
|
|
|
42 |
intent.putExtra("completed", true);
|
|
|
43 |
setResult(RESULT_OK, intent);
|
|
|
44 |
intent.putExtra("requestCode", Constants.REQUEST_CODE_TEXT);
|
|
|
45 |
finish();
|
|
|
46 |
}
|
|
|
47 |
}
|