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
private fun openBottomSheetDialog() { | |
val view = layoutInflater.inflate(R.layout.bottom_sheet_dialog, null) | |
val dialog = BottomSheetDialog(context) | |
dialog.setContentView(view) | |
dialog.show() | |
dialog.findViewById<LinearLayout>(R.id.button_1)!!.setOnClickListener { | |
println("button 1 is clicked") | |
} | |
dialog.findViewById<LinearLayout>(R.id.button_1)!!.setOnClickListener { |
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.elevintech.alarmmanager"> | |
<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
import android.app.DatePickerDialog | |
import android.widget.EditText | |
import java.text.DecimalFormat | |
import android.graphics.Color | |
import android.graphics.drawable.ColorDrawable | |
dateText.setOnClickListener { | |
setDatePickerAction(it as EditText) | |
openDatePicker() | |
} |
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 android.Manifest | |
import com.github.florent37.runtimepermission.RuntimePermission | |
import android.provider.MediaStore | |
import java.util.* | |
import java.io.File | |
import android.net.Uri | |
import android.content.Intent | |
var imageUri: Uri? = null | |
var OPEN_CAMERA = 10 |
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
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.READ_CONTACTS" /> | |
<uses-permission android:name="android.permission.CAMERA" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> |
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"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle" > | |
<!-- background color --> | |
<solid android:color="@android:color/darker_gray"/> | |
<!-- border color and width --> | |
<stroke android:width="10dp" | |
android:color="@android:color/white"/> |
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
androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/recycler_view_chat" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> |
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
implementation 'com.google.android.material:material:1.0.0' |
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"?> | |
<shape android:shape="oval" | |
xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- border color and width --> | |
<stroke android:width="0.5dp" android:color="@android:color/darker_gray"/> | |
<!-- background color --> | |
<solid android:color="@android:color/white"/> |
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 | |
import android.os.Handler; | |
// Use | |
val handler = Handler() | |
handler.postDelayed({ | |
// do something after 1000ms | |
}, 1000) |
NewerOlder