-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
185 additions
and
20 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains 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,3 +1,3 @@ | ||
# https://help.github.com/en/articles/about-code-owners | ||
|
||
* @PoornimaApptentive @frankus | ||
* @PoornimaApptentive @frankus @luqKhan |
This file contains 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 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 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 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 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 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 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 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 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 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
5 changes: 5 additions & 0 deletions
5
...ate-to-link/src/main/java/apptentive/com/android/feedback/link/NavigateToLinkViewModel.kt
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package apptentive.com.android.feedback.link | ||
|
||
import androidx.lifecycle.ViewModel | ||
|
||
internal class NavigateToLinkViewModel : ViewModel() |
This file contains 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
3 changes: 2 additions & 1 deletion
3
...link/NavigateToLinkInteractionLauncher.kt → ...tion/NavigateToLinkInteractionLauncher.kt
This file contains 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
2 changes: 1 addition & 1 deletion
2
...NavigateToLinkInteractionTypeConverter.kt → ...NavigateToLinkInteractionTypeConverter.kt
This file contains 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
29 changes: 29 additions & 0 deletions
29
...ink/src/main/java/apptentive/com/android/feedback/link/view/BaseNavigateToLinkActivity.kt
This file contains 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package apptentive.com.android.feedback.link.view | ||
|
||
import androidx.activity.viewModels | ||
import apptentive.com.android.feedback.Apptentive | ||
import apptentive.com.android.feedback.ApptentiveActivityInfo | ||
import apptentive.com.android.feedback.link.NavigateToLinkViewModel | ||
import apptentive.com.android.ui.ApptentiveViewModelActivity | ||
import apptentive.com.android.ui.ViewModelFactory | ||
|
||
/** | ||
* Base Activity for Navigate To Link web view | ||
* | ||
* This class should be used as base activity for Navigate to Link that wish to use | ||
* full interface customization | ||
* | ||
* ApptentiveActivityInfo added for easier integration of future features | ||
*/ | ||
internal open class BaseNavigateToLinkActivity : ApptentiveViewModelActivity(), ApptentiveActivityInfo { | ||
|
||
val viewModel: NavigateToLinkViewModel by viewModels { | ||
ViewModelFactory { NavigateToLinkViewModel() } | ||
} | ||
override fun getApptentiveActivityInfo() = this | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
Apptentive.registerApptentiveActivityInfoCallback(this) | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...to-link/src/main/java/apptentive/com/android/feedback/link/view/NavigateTolinkActivity.kt
This file contains 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package apptentive.com.android.feedback.link.view | ||
|
||
import android.os.Bundle | ||
import android.webkit.WebView | ||
import apptentive.com.android.feedback.link.R | ||
import apptentive.com.android.ui.hideSoftKeyboard | ||
import com.google.android.material.appbar.MaterialToolbar | ||
|
||
internal class NavigateTolinkActivity : BaseNavigateToLinkActivity() { | ||
private lateinit var webView: WebView | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.apptentive_activity_navigate_to_link) | ||
|
||
supportActionBar?.hide() | ||
|
||
val topAppBar = findViewById<MaterialToolbar>(R.id.apptentive_top_app_bar) | ||
topAppBar.setNavigationOnClickListener { | ||
it.hideSoftKeyboard() | ||
finish() | ||
} | ||
|
||
webView = findViewById<WebView>(R.id.apptentive_webview_navigate_to_link) | ||
webView.settings.javaScriptEnabled = true | ||
val url = intent.getStringExtra("linkUrl") | ||
if (savedInstanceState != null) { | ||
webView.restoreState(savedInstanceState) | ||
} else | ||
url?.let { webView.loadUrl(it) } | ||
} | ||
|
||
override fun onSaveInstanceState(outState: Bundle) { | ||
super.onSaveInstanceState(outState) | ||
webView.saveState(outState) | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
apptentive-navigate-to-link/src/main/res/layout/apptentive_activity_navigate_to_link.xml
This file contains 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<com.google.android.material.appbar.AppBarLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
android:touchscreenBlocksFocus="false"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<com.google.android.material.appbar.MaterialToolbar | ||
android:id="@+id/apptentive_top_app_bar" | ||
style="?apptentiveNavigateToLinkToolbarStyle" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:touchscreenBlocksFocus="false" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"> | ||
|
||
<ImageView | ||
android:id="@+id/apptentive_link_image_header" | ||
style="?apptentiveNavigateToLinkImageStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:contentDescription="@null" /> | ||
|
||
</com.google.android.material.appbar.MaterialToolbar> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</com.google.android.material.appbar.AppBarLayout> | ||
|
||
<WebView | ||
android:id="@+id/apptentive_webview_navigate_to_link" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains 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
2 changes: 1 addition & 1 deletion
2
...-link/src/test/java/apptentive/com/android/feedback/link/NavigateToLinkInteractionTest.kt
This file contains 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 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 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