This file contains hidden or 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
import 'package:collection/collection.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:intl/intl.dart'; | |
void main() { | |
runApp(const CalendarGeneratorApp()); | |
} | |
class CalendarGeneratorApp extends StatelessWidget { | |
const CalendarGeneratorApp({super.key}); |
This file contains hidden or 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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.jetpackcompose"> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" |
This file contains hidden or 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
plugins { | |
id 'com.android.application' | |
id 'kotlin-android' | |
} | |
android { | |
compileSdkVersion 29 | |
buildToolsVersion "29.0.3" | |
defaultConfig { |
This file contains hidden or 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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
ext.kotlin_version = '1.3.71' | |
def compose_release_version = "dev11" | |
ext.compose_version = "0.1.0-$compose_release_version" | |
ext.compose_compiler_extension_version = "0.1.0-$compose_release_version" | |
repositories { | |
google() | |
jcenter() |
This file contains hidden or 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
@Preview | |
@Composable | |
private fun UniversityCardPreview() { | |
val university = University(uniName = "Harvard University", uniAddress = "United States") | |
MaterialTheme { | |
UniversityCard(university) | |
} | |
} |
This file contains hidden or 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 UniversityCard(university: University) { | |
Box(padding = 8.dp) { | |
Card( | |
shape = RoundedCornerShape(4.dp), | |
elevation = 4.dp, | |
color = Color.White | |
) { | |
Clickable( | |
modifier = Modifier.ripple(), |
This file contains hidden or 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
// normal function | |
fun showGreeting(name:String){ | |
// tv_greeting is defined in xml layout | |
tv_greeting.text = "Hello $name" | |
} | |
// composable function | |
@Composable | |
fun GreetingText(name:String){ | |
Text(text = "Hello $name") |
This file contains hidden or 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
public class Utils { | |
public static String getZplCode(Bitmap bitmap, Boolean addHeaderFooter) { | |
ZPLConverter zp = new ZPLConverter(); | |
zp.setCompressHex(true); | |
zp.setBlacknessLimitPercentage(50); | |
Bitmap grayBitmap = toGrayScale(bitmap); | |
return zp.convertFromImage(grayBitmap, addHeaderFooter); | |
} |
NewerOlder