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"?> | |
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:id="@+id/dashboardfragment" | |
android:icon="@drawable/ic_home_white_32dp" | |
android:title="Dashboard"></item> | |
<item android:id="@+id/reportfragment" | |
android:icon="@drawable/ic_person_outline_white_32dp" | |
android:title="Report"></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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
ext.kotlin_version = '1.3.21' | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { |
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
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
apply plugin: 'kotlin-kapt' | |
apply plugin: 'androidx.navigation.safeargs.kotlin' |
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
===========================in adapter ====================== | |
viewHolder.linecar.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
selected_position = i; | |
notifyDataSetChanged(); | |
Log.e("position",""+selected_position); | |
Intent intent = new Intent("custom-message"); | |
// intent.putExtra("quantity",Integer.parseInt(quantity.getText().toString())); |
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
private SensorManager mSensorManager; | |
private Sensor mOrientation; | |
boolean Upsidedown = false; | |
float value_0 = -10000; | |
float value_1 = -10000; | |
float deviceRotation = 0.0f; | |
boolean ispotrait = false; | |
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.yudikarma.androidcamera.Sqlite; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.database.DatabaseUtils; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; |
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"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<com.example.yudikarma.androidcamera.Helper.AutoFitTextureView | |
android:id="@+id/textureview" | |
android:layout_width="wrap_content" |
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
/** | |
* @return The largest supported picture size. | |
*/ | |
public Size getDefaultPictureSize() { | |
StreamConfigurationMap configs = mCharacteristics.get( | |
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); | |
android.util.Size[] supportedSizes = configs.getOutputSizes(sCaptureImageFormat); | |
// Find the largest supported size. | |
android.util.Size largestSupportedSize = supportedSizes[0]; |
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.yudikarma.androidcamera.Helper; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.TextureView; | |
/** | |
* A {@link TextureView} that can be adjusted to a specified aspect ratio. | |
*/ | |
public class AutoFitTextureView extends TextureView { |
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
private void captureStillPicture() { | |
try { | |
if (null == mCameraDevice ) { | |
return; | |
} | |
// This is the CaptureRequest.Builder that we use to take a picture. | |
final CaptureRequest.Builder captureBuilder = | |
mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE); | |
captureBuilder.addTarget(mImageReader.getSurface()); |