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
<!-- for light --> | |
<item name="android:statusBarColor">@android:color/transparent</item> | |
<item name="android:windowLightStatusBar">true</item> | |
<!-- for dark --> | |
<item name="android:statusBarColor">@android:color/transparent</item> | |
<item name="android:windowLightStatusBar">false</item> |
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.myapplication | |
import android.os.Bundle | |
import android.view.MenuItem | |
import androidx.appcompat.app.AppCompatActivity | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) |
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
FutureBuilder<List<SuperHero>>( | |
future: futureSuperHeros, | |
builder: (context, snapshot) { | |
if (snapshot.hasData) { | |
return buildList(snapshot.requireData); | |
} else if (snapshot.hasError) { | |
return Text('${snapshot.error}'); | |
} | |
return const CircularProgressIndicator(); | |
}, |
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
goToSuperHeroPage(SuperHero superHero) { | |
Navigator.push( | |
context, | |
MaterialPageRoute( | |
builder: (context) => SuperHeroPage(superHero: superHero)), | |
); | |
} |
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
ListView buildList(List<SuperHero> list) { | |
return ListView.builder( | |
padding: const EdgeInsets.all(8), | |
itemCount: list.length, | |
itemBuilder: (BuildContext context, int index) { | |
return GestureDetector( | |
onTap: () => goToSuperHeroPage(list[index]), | |
child: SuperHeroCard(superHero: list[index]), | |
); | |
}); |
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
from pynput.mouse import Button, Controller | |
import keyboard | |
import time | |
mouse = Controller() | |
print ("Current position: " + str(mouse.position)) | |
isActive = False |