-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b873cf
commit 28b52ab
Showing
4 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
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
31 changes: 28 additions & 3 deletions
31
agronweb/src/main/java/cn/sovegetables/web/ProcessCommonWebActivity.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 |
---|---|---|
@@ -1,10 +1,35 @@ | ||
package cn.sovegetables.web | ||
|
||
import android.os.Bundle | ||
import android.app.Activity | ||
import android.content.Intent | ||
import androidx.fragment.app.Fragment | ||
|
||
open class ProcessCommonWebActivity : CommonWebActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
companion object{ | ||
|
||
fun start(activity: Activity, url: String){ | ||
start(activity, WebConfig(url = url, enableAutoTitle = true)) | ||
} | ||
|
||
fun start(activity: Activity, webConfig: WebConfig){ | ||
val intent = Intent(activity, ProcessCommonWebActivity::class.java) | ||
putWebConfig(intent, webConfig) | ||
activity.startActivity(intent) | ||
} | ||
|
||
fun start(fragment: Fragment, url: String){ | ||
start(fragment, WebConfig(url = url, enableAutoTitle = true)) | ||
} | ||
|
||
fun start(fragment: Fragment, webConfig: WebConfig){ | ||
val intent = Intent(fragment.requireContext(), ProcessCommonWebActivity::class.java) | ||
putWebConfig(intent, webConfig) | ||
fragment.startActivity(intent) | ||
} | ||
|
||
fun setIWebModule(module: IWebModule){ | ||
CommonWebActivity.setIWebModule(module) | ||
} | ||
} | ||
} |
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