Skip to content

Commit

Permalink
Merge pull request #194 from Infomaniak/imp/information-block
Browse files Browse the repository at this point in the history
 Rename FeedbackWebView to Webview and move it out of Stores as it is now used elsewhere
  • Loading branch information
tevincent committed Jun 6, 2024
2 parents 0dba4e5 + ef8996d commit 9a0cefd
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
4 changes: 0 additions & 4 deletions Stores/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
android:fullBackupContent="false"
tools:targetApi="UPSIDE_DOWN_CAKE">

<activity
android:name="com.infomaniak.lib.stores.ui.FeedbackWebViewActivity"
android:windowSoftInputMode="adjustResize" />

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package com.infomaniak.lib.stores.reviewmanagers

import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.LifecycleOwner
import com.infomaniak.lib.core.ui.WebViewActivity
import com.infomaniak.lib.stores.BaseInAppReviewManager
import com.infomaniak.lib.stores.StoreUtils.launchInAppReview
import com.infomaniak.lib.stores.ui.FeedbackWebViewActivity
import com.infomaniak.lib.stores.ui.dialogs.ReviewAlertDialog
import com.infomaniak.lib.stores.ui.dialogs.ReviewAlertDialogData
import com.infomaniak.lib.core.R as RCore
Expand Down Expand Up @@ -83,7 +83,7 @@ class InAppReviewManager(
onPositiveButtonClicked = ::onUserWantToReview,
onNegativeButtonClicked = {
onUserWantsToGiveFeedback?.invoke()
FeedbackWebViewActivity.startActivity(this, getString(feedbackUrlResId))
WebViewActivity.startActivity(this, getString(feedbackUrlResId))
},
),
).show()
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'androidx.navigation.safeargs.kotlin'

android {
namespace 'com.infomaniak.lib.core'
Expand Down
15 changes: 14 additions & 1 deletion src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,23 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission
android:name="android.permission.POST_NOTIFICATIONS"
android:minSdkVersion="33" />

<application
android:allowBackup="false"
android:fullBackupContent="false"
android:usesCleartextTraffic="false"
tools:targetApi="UPSIDE_DOWN_CAKE">

<activity
android:name="com.infomaniak.lib.core.ui.WebViewActivity"
android:windowSoftInputMode="adjustResize" />

</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.lib.stores.ui
package com.infomaniak.lib.core.ui

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.navArgs
import com.infomaniak.lib.stores.databinding.ActivityFeedbackWebviewBinding
import com.infomaniak.lib.core.databinding.ActivityWebviewBinding

class FeedbackWebViewActivity : AppCompatActivity() {
class WebViewActivity : AppCompatActivity() {

private val binding by lazy { ActivityFeedbackWebviewBinding.inflate(layoutInflater) }
private val navArgs: FeedbackWebViewActivityArgs by navArgs()
private val binding by lazy { ActivityWebviewBinding.inflate(layoutInflater) }
private val navArgs: WebViewActivityArgs by navArgs()

@SuppressLint("SetJavaScriptEnabled")
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -43,8 +43,8 @@ class FeedbackWebViewActivity : AppCompatActivity() {
companion object {

fun startActivity(context: Context, url: String) {
Intent(context, FeedbackWebViewActivity::class.java).apply {
putExtras(FeedbackWebViewActivityArgs(url).toBundle())
Intent(context, WebViewActivity::class.java).apply {
putExtras(WebViewActivityArgs(url).toBundle())
}.also(context::startActivity)
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/feedback_webview_navigation"
app:startDestination="@id/feedbackWebViewActivity">
android:id="@+id/webview_navigation"
app:startDestination="@id/webViewActivity">

<activity
android:id="@+id/feedbackWebViewActivity"
android:name="com.infomaniak.lib.stores.ui.FeedbackWebViewActivity"
android:label="FeedbackWebViewActivity"
tools:layout="@layout/activity_feedback_webview">
android:id="@+id/webViewActivity"
android:name="com.infomaniak.lib.core.ui.WebViewActivity"
android:label="WebViewActivity"
tools:layout="@layout/activity_webview">

<argument
android:name="url"
Expand Down

0 comments on commit 9a0cefd

Please sign in to comment.