Skip to content

Commit

Permalink
UI updates and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Nov 9, 2023
1 parent df36794 commit 5096a43
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .idea/assetWizardSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions app/src/main/java/org/witness/proofmode/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,13 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
val id = item.itemId
if (id == R.id.action_publish_key) {
publishKey()
return true
} else if (id == R.id.action_share_key) {
if (id == R.id.action_share_key) {
shareCurrentPublicKey()
return true
} else if (id == R.id.action_share_photos) {
showImagePicker();
} else if (id == R.id.action_share_videos) {
showVideoPicker();
} else if (id == R.id.action_share_documents) {
showDocumentPicker();
}
return super.onOptionsItemSelected(item)
}
Expand Down
16 changes: 13 additions & 3 deletions app/src/main/java/org/witness/proofmode/SingleAssetView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
Expand Down Expand Up @@ -240,9 +241,18 @@ fun SingleAssetView(initialItem: ProofableItem, modifier: Modifier = Modifier, s

var hash = ProofModeUtil.getProofHash(initialItem.uri,context)
if (hash != null) {
var summary = ProofModeUtil.getProofSummary(hash, context)
if (summary?.isNotEmpty() == true)
Text(modifier = Modifier.padding(3.dp,3.dp), text = "$summary")

var hmap = ProofModeUtil.getProofHashMap(hash, context)

if (hmap != null) {
for (key in hmap?.keys!!) {
Row {
Text(modifier = Modifier.padding(3.dp, 3.dp).width(120.dp).background(Color.LightGray), text = "$key")
SelectionContainer() { Text(modifier = Modifier.padding(3.dp, 3.dp), text = "${hmap[key]}") }
}
}
}

}


Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
app:theme="@style/MainToolBarStyle"
android:backgroundTint="@color/colorPrimaryDark"

app:popupTheme="@style/AppTheme.PopupOverlay" />

<androidx.compose.ui.platform.ComposeView
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
android:title="Open Picture or Video"
/>
-->

<!--
<item
android:id="@+id/action_publish_key"
android:orderInCategory="100"
android:title="@string/action_publish_key"
app:showAsAction="never"
android:visible="false"
/>

-->
<item
android:id="@+id/action_share_key"
android:orderInCategory="100"
Expand All @@ -36,11 +36,12 @@
android:orderInCategory="100"
android:title="@string/menu_import_videos"
app:showAsAction="never" />
<!--
<item
android:id="@+id/action_share_documents"
android:orderInCategory="100"
android:title="@string/menu_import_documents"
app:showAsAction="never" />

-->

</menu>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<string name="menu_import_videos">Import videos...</string>
<string name="menu_import_documents">Import documents...</string>

<string name="title_activity">Activity</string>
<string name="title_activity">Proof Log</string>

<string name="cd_take_picture">Take picture</string>
<string name="cb_open_gallery">Navigate to Gallery</string>
Expand Down

0 comments on commit 5096a43

Please sign in to comment.