[app] Show package name

This commit is contained in:
tehcneko 2021-02-09 22:24:38 +08:00
parent 081a0c664d
commit 81f6756e82
2 changed files with 5 additions and 5 deletions

View File

@ -23,6 +23,7 @@ package io.github.lsposed.manager.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable; import android.os.Parcelable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -139,12 +140,13 @@ public class RepoActivity extends BaseActivity implements RepoLoader.Listener {
public void onBindViewHolder(@NonNull ViewHolder holder, int position) { public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
OnlineModule module = showList.get(position); OnlineModule module = showList.get(position);
holder.appName.setText(module.getDescription()); holder.appName.setText(module.getDescription());
SpannableStringBuilder sb = new SpannableStringBuilder(module.getName());
String summary = module.getSummary(); String summary = module.getSummary();
if (summary != null) { if (summary != null) {
holder.appDescription.setText(module.getSummary()); sb.append("\n");
} else { sb.append(summary);
holder.appDescription.setVisibility(View.GONE);
} }
holder.appDescription.setText(sb);
holder.itemView.setOnClickListener(v -> { holder.itemView.setOnClickListener(v -> {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(RepoActivity.this, RepoItemActivity.class); intent.setClass(RepoActivity.this, RepoItemActivity.class);

View File

@ -190,11 +190,9 @@ public class RepoItemActivity extends BaseActivity {
} }
} }
if (position == 0) { if (position == 0) {
binding.appBar.setLiftOnScrollTargetViewId(R.id.scrollView);
holder.textView.setTransformationMethod(new LinkTransformationMethod(RepoItemActivity.this)); holder.textView.setTransformationMethod(new LinkTransformationMethod(RepoItemActivity.this));
markwon.setMarkdown(holder.textView, module.getReadme()); markwon.setMarkdown(holder.textView, module.getReadme());
} else { } else {
binding.appBar.setLiftOnScrollTargetViewId(R.id.recyclerView);
ReleaseAdapter adapter = new ReleaseAdapter(module.getReleases()); ReleaseAdapter adapter = new ReleaseAdapter(module.getReleases());
holder.recyclerView.setAdapter(adapter); holder.recyclerView.setAdapter(adapter);
holder.recyclerView.setLayoutManager(new LinearLayoutManagerFix(RepoItemActivity.this)); holder.recyclerView.setLayoutManager(new LinearLayoutManagerFix(RepoItemActivity.this));