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
// ==UserScript== | |
// @name 2 Open youtube channels on Social Blade | |
// @namespace Violentmonkey Scripts | |
// @match https://*.youtube.com/* | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description This script will open the Youtube channel in the Social Balde | |
// ==/UserScript== |
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
@Composable | |
fun SomeScreen(){ | |
val selectedItems:List<Type> = remeber {mutableStateOf(listOf())} | |
val someList:List<SomeType> = stateFromViewModel | |
LazyColumn(){ | |
Items(selectItems.size){ | |
selectItems.value[it].someProperty |
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
@composable | |
fun SomeComposeFunction(){ | |
val application = context.applicationContext as App | |
WebView( | |
"https://www.google.com", | |
application | |
) | |
// For handling the back press | |
BackHandler { |
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
@Composable | |
fun MyWebView( | |
urlToRender: String, | |
application: App, | |
) { | |
Column { | |
AndroidView(factory = { context -> | |
application.myViewFun(context, urlToRender) | |
}, update = { |
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
var myView: WebView? = null | |
@SuppressLint("SetJavaScriptEnabled") | |
fun myWebViewFun(context: Context, urlToRender: String): WebView { | |
if (myView == null) { | |
myView = WebView(context).apply { | |
layoutParams = ViewGroup.LayoutParams( | |
ViewGroup.LayoutParams.MATCH_PARENT, | |
ViewGroup.LayoutParams.MATCH_PARENT | |
) | |
webViewClient = object : WebViewClient() { |
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
package com.example.fragment | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import androidx.databinding.DataBindingUtil | |
import androidx.fragment.app.Fragment | |
import com.example.fragment.databinding.ActivityMainBinding | |
enum class FragmentName { | |
HOME, PROFILE, ABOUT |