mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-05 21:00:50 +08:00
feat(mian):use markwon to show markdown
This commit is contained in:
parent
0fc56dc2b0
commit
8d3b9f5c07
@ -110,6 +110,7 @@ dependencies {
|
||||
implementation 'com.google.android.material:material:1.7.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
|
||||
implementation 'com.elvishew:xlog:1.11.0'
|
||||
implementation 'io.noties.markwon:core:4.6.2'
|
||||
implementation files('libs/BaiduLBS_Android.jar')
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
|
||||
@ -106,6 +106,7 @@ import static android.view.View.GONE;
|
||||
|
||||
import com.elvishew.xlog.XLog;
|
||||
|
||||
import io.noties.markwon.Markwon;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.OkHttpClient;
|
||||
@ -1428,10 +1429,8 @@ public class MainActivity extends BaseActivity implements SensorEventListener {
|
||||
updateCommit.setText(getRetJson.getString("target_commitish"));
|
||||
|
||||
TextView updateContent = window.findViewById(R.id.update_content);
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder();
|
||||
ssb.append(getRetJson.getString("body"));
|
||||
updateContent.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
updateContent.setText(ssb, TextView.BufferType.SPANNABLE);
|
||||
final Markwon markwon = Markwon.create(MainActivity.this);
|
||||
markwon.setMarkdown(updateContent, getRetJson.getString("body"));
|
||||
|
||||
Button updateCancel = window.findViewById(R.id.update_ignore);
|
||||
updateCancel.setOnClickListener(v -> alertDialog.cancel());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user