mirror of https://github.com/ThmmyNoLife/mTHMMY
Thodoris1999
6 years ago
6 changed files with 116 additions and 11 deletions
@ -0,0 +1,28 @@ |
|||
package gr.thmmy.mthmmy.activities; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import gr.thmmy.mthmmy.R; |
|||
import gr.thmmy.mthmmy.utils.parsing.BBParser; |
|||
import timber.log.Timber; |
|||
|
|||
import android.os.Bundle; |
|||
import android.text.SpannableStringBuilder; |
|||
import android.widget.TextView; |
|||
|
|||
public class TestActivity extends AppCompatActivity { |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.activity_test); |
|||
|
|||
String bb = "[b]An [i]elep[u]hant[/i][/b] swi[/u]ms in [s]the[/s] tree"; |
|||
SpannableStringBuilder result = BBParser.bb2span(bb); |
|||
|
|||
TextView bbRaw = findViewById(R.id.bb_raw); |
|||
TextView bb2Text = findViewById(R.id.bb2text); |
|||
|
|||
bbRaw.setText(bb); |
|||
bb2Text.setText(result); |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="vertical" |
|||
tools:context=".activities.TestActivity"> |
|||
|
|||
<TextView |
|||
android:id="@+id/bb_raw" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/bb2text" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" /> |
|||
|
|||
</LinearLayout> |
Loading…
Reference in new issue