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 more information about using CMake with Android Studio, read the | |
# documentation: https://d.android.com/studio/projects/add-native-code.html | |
# Sets the minimum version of CMake required to build the native library. | |
cmake_minimum_required(VERSION 3.4.1) | |
# Creates and names a library, sets it as either STATIC | |
# or SHARED, and provides the relative paths to its source code. | |
# You can define multiple libraries, and CMake builds them for you. |
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
//--------------Utils Class start-------------------- | |
sealed class MenuOptions { | |
object TaskList : MenuOptions() | |
object AddTask : MenuOptions() | |
data class ModifyTask(val task: Task) : MenuOptions() | |
} | |
object AppMain { | |
private var current_screen: MenuOptions = MenuOptions.TaskList | |
var route_screen by mutableStateOf(current_screen) |
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 AddTask() { | |
val title = remember { mutableStateOf("") } | |
val titleExist = remember { mutableStateOf(false) } | |
if (titleExist.value) Text( | |
modifier = Modifier.padding(5.dp), | |
text = "Title already exist", | |
style = TextStyle(color = Color(0xFFF50B0B)) + MaterialTheme.typography.body1 | |
) |
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
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
MaterialTheme { | |
Column { | |
ItemCell(item = Item("cat 1", "https://thumbs-prod.si-cdn.com/s-rtW1rEAQTIGcmUVNFSSPC4s3I=/800x600/filters:no_upscale()/https://public-media.si-cdn.com/filer/56/4a/564a542d-5c37-4be7-8892-98201ab13180/cat-2083492_1280.jpg")) | |
ItemCell(item = Item("cat 2", "https://images.pexels.com/photos/104827/cat-pet-animal-domestic-104827.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260")) | |
} |
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
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.expandable, container, false); | |
ExpandableAdapter adapter = new ExpandableAdapter(); | |
expandableListView.setAdapter(adapter); | |
setExpandableListViewHeight(expandableListView, -1); | |
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { | |
@Override | |
public boolean onGroupClick(ExpandableListView parent, View v, int position, long id) { |
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.dexode.fragment; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.support.v4.app.Fragment; | |
import android.view.KeyEvent; |
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
class RegistrationFragment : Fragment() { | |
private lateinit var bi: FragmentRegistrationBinding | |
lateinit var vModel: MainViewModel | |
private val flag: RegistrationFragmentArgs by navArgs() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
vModel = activity?.run { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<fragment |
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
public class LocalBroadcastReceiver extends BroadcastReceiver { | |
@Override public void onReceive(Context context, Intent intent) { | |
Log.d("LocalBroadcastReceiver", "onReceive()"); | |
// Tell the result receiver to CANCEL some specific action. | |
// eg. do not display System Notification | |
setResultCode(Activity.RESULT_CANCELED); | |
} | |
} |
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
public class LocationService extends Service { | |
public static final String BROADCAST_ACTION = "GettingLoc"; | |
private static final int TWO_MINUTES = 1000 * 60 * 2; | |
private static final long MINIMUM_DISTANCE_CHANGE_FOR_UPDATES = 1; // in Meters | |
private static final long MINIMUM_TIME_BETWEEN_UPDATES = 2000; // in Milliseconds | |
public LocationManager locationManager; | |
public GPSLocationListener listener; | |
public Location previousBestLocation = null; | |
Intent intent; |