This repository was archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Added App information in about section #350
Open
devanshi7799
wants to merge
2
commits into
getodk:master
Choose a base branch
from
devanshi7799:skunkworks-crow1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package org.odk.share.views.ui.about; | ||
|
||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.appcompat.widget.Toolbar; | ||
import androidx.browser.customtabs.CustomTabsIntent; | ||
import androidx.recyclerview.widget.LinearLayoutManager; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
|
@@ -22,6 +24,7 @@ public class AboutActivity extends AppCompatActivity implements OnItemClickListe | |
|
||
private static final String LICENSES_HTML_PATH = "file:///android_asset/open_source_licenses.html"; | ||
private static final String USER_GUIDE_HTML_PATH = "file:///android_asset/user_guide.html"; | ||
private static final String SKUNKWORKS_CROW_README_URL = "https://github.com/opendatakit/skunkworks-crow/blob/master/README.md"; | ||
|
||
@BindView(R.id.recyclerview) | ||
RecyclerView recyclerView; | ||
|
@@ -30,6 +33,7 @@ public class AboutActivity extends AppCompatActivity implements OnItemClickListe | |
|
||
private AboutAdapter adapter; | ||
|
||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
@@ -47,19 +51,25 @@ protected void onCreate(Bundle savedInstanceState) { | |
llm.setOrientation(RecyclerView.VERTICAL); | ||
recyclerView.setLayoutManager(llm); | ||
adapter = new AboutAdapter(this, this); | ||
adapter.addItem(new AboutItem(R.string.app_information, R.drawable.ic_stars)); | ||
adapter.addItem(new AboutItem(R.string.open_source_licenses, R.drawable.ic_stars)); | ||
adapter.addItem(new AboutItem(R.string.user_guide, R.drawable.ic_stars)); | ||
recyclerView.setAdapter(adapter); | ||
} | ||
|
||
@Override | ||
@Override | ||
public void onItemClick(View view, int position) { | ||
if (position == 0) { | ||
|
||
new CustomTabsIntent.Builder() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My main concern was that what if the device doesn't support custom tabs, it would be easier for you to understand if you can explore ODK-Collect Custom tabs implementation that they have because that handles lot of things which we might not be able to test on our devices, there are even few devices which doesn't have browser in them, so this change may crash the app on those devices. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lakshyagupta21 Should i make changes according to odk-collect custom tabs? |
||
.build() | ||
.launchUrl(this, Uri.parse(SKUNKWORKS_CROW_README_URL)); | ||
} else if (position == 1) { | ||
Intent intent = new Intent(this, WebViewActivity.class); | ||
intent.putExtra(OPEN_URL, LICENSES_HTML_PATH); | ||
intent.putExtra(TITLE, getString(R.string.open_source_licenses)); | ||
startActivity(intent); | ||
} else if (position == 1) { | ||
} else if (position == 2) { | ||
Intent intent = new Intent(this, WebViewActivity.class); | ||
intent.putExtra(OPEN_URL, USER_GUIDE_HTML_PATH); | ||
intent.putExtra(TITLE, getString(R.string.user_guide)); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why introducing a third-party lib for this small feature @devanshi7799 ? If I were you, I will implement that using a simple web view.
Downsides for introducing a new lib in this case are:
So we are trying not to use third-party libs unless we have to do that, I think this would be helpful for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @huangyz0918, it's a custom tabs dependency, and nowadays every app has in-app browser feature which provides a look and feel of the browser within the app without actually moving out of the app, so I think its fine we even have this in ODK-Collect but not AndroidX dependency. I think @devanshi7799 this is fine no need to explore the webview as of now, if any feature ask comes in future then we can pick that up or if it we face any issues due to this then we can pick this up.