Skip to content

Commit

Permalink
Separator added to BulletViewHolder and android manifest file parse i…
Browse files Browse the repository at this point in the history
…n ApkDetailsSource
  • Loading branch information
ekrmh authored and xgouchet committed Oct 15, 2020
1 parent 3719ed0 commit db2ae3a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ class AppInfoBulletViewHolder(
private val iconView: ImageView = itemView.findViewById(R.id.icon)
private val nameView: TextView = itemView.findViewById(R.id.name)
private val valueView: TextView = itemView.findViewById(R.id.value)
private val separatorView: TextView = itemView.findViewById(R.id.separator)

override fun onBindAppInfoItem(item: AppInfoBullet) {
nameView.text = item.name
valueView.text = item.value
separatorView.text = item.separator
iconView.setImageResource(item.icon)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ data class AppInfoBullet(
val name: String,
val value: String,
val raw: String? = null,
val separator: String = "=",
@DrawableRes val icon: Int = R.drawable.ic_bullet

) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package fr.xgouchet.packageexplorer.details.apk

import android.content.Context
import android.content.pm.PackageManager
import fr.xgouchet.packageexplorer.core.utils.exportManifestDomFromPackage
import fr.xgouchet.packageexplorer.core.utils.parseDocumentToManifest
import fr.xgouchet.packageexplorer.details.DetailsSource
import fr.xgouchet.packageexplorer.details.adapter.AppInfoViewModel
import io.reactivex.ObservableEmitter
Expand Down Expand Up @@ -46,6 +48,8 @@ class ApkDetailsSource(
?: packageManager.getPackageArchiveInfo(path, PACKAGE_INFO_FLAGS_NO_SIGN)

if (packageInfo != null) {
androidManifestXml = exportManifestDomFromPackage(packageInfo).parseDocumentToManifest()

extractMainInfo(emitter, packageInfo, null, File(path))

extractSignatures(emitter, packageInfo)
Expand Down
23 changes: 19 additions & 4 deletions app/src/main/res/layout/item_info_bullet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,35 @@
app:layout_constraintTop_toTopOf="@+id/icon"
tools:text="Foo" />

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/separator"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginHorizontal="4dp"
android:ellipsize="start"
android:gravity="center_vertical"
android:singleLine="true"
tools:text="="
android:textAppearance="@style/AppTheme.TextAppearanceUltraSmall"
android:textColor="@color/text_title"
app:layout_constraintBottom_toBottomOf="@+id/name"
app:layout_constraintStart_toEndOf="@+id/name"
app:layout_constraintTop_toTopOf="@+id/name" />

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/value"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="8dp"
android:layout_marginHorizontal="4dp"
android:ellipsize="start"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/AppTheme.TextAppearanceUltraSmall"
android:textColor="@color/text_title"
app:layout_constraintBottom_toBottomOf="@+id/name"
app:layout_constraintBottom_toBottomOf="@+id/separator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/name"
app:layout_constraintTop_toTopOf="@+id/name"
app:layout_constraintStart_toEndOf="@+id/separator"
app:layout_constraintTop_toTopOf="@+id/separator"
tools:text="Foo" />

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit db2ae3a

Please sign in to comment.