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
| fun addKeyboardVisibilityListener( | |
| rootLayout: View, | |
| onKeyboardVisibiltyListener: OnKeyboardVisibiltyListener | |
| ) { | |
| rootLayout.viewTreeObserver.addOnGlobalLayoutListener { | |
| val r = Rect() | |
| rootLayout.getWindowVisibleDisplayFrame(r) | |
| val screenHeight = rootLayout.rootView.height | |
| // r.bottom is the position above soft keypad or device button. |
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.os.Bundle | |
| import android.widget.Toast | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.lifecycle.Observer | |
| import androidx.lifecycle.ViewModelProvider | |
| import kotlinx.android.synthetic.main.activity_main.* | |
| class MainActivity : AppCompatActivity() { | |
| lateinit var viewModel: SampleViewModel |
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.Activity; | |
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.view.View.OnClickListener; | |
| public class MainActivity extends Activity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.main); |
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
| /** | |
| * Hides the activity's action bar | |
| * | |
| * @param activity the activity | |
| */ | |
| public static void hideActionBar(Activity activity) { | |
| // Call before calling setContentView(); | |
| if (activity != null) { | |
| activity.getWindow().requestFeature(Window.FEATURE_ACTION_BAR); | |
| if (activity.getActionBar() != null) { |
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
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_location_found); | |
| // get action bar | |
| ActionBar actionBar = getActionBar(); | |
| // Enabling Up / Back navigation | |
| actionBar.setDisplayHomeAsUpEnabled(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 'package:background_fetch/background_fetch.dart'; | |
| import 'dart:convert'; | |
| import 'package:dot/theme_values.dart'; | |
| import 'package:dot/ui/PickupExecutive/DropListVC.dart'; | |
| import 'package:dot/ui/firebase/PushNotificationService.dart'; | |
| import 'package:dot/ui/customer/HomeCustomerVC.dart'; | |
| import 'package:dot/ui/homeSales/homeVC.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; |
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 'dart:convert'; | |
| import 'package:dot/ui/model/GeneralMasterData.dart'; | |
| import 'package:dot/ui/model/StateCity.dart'; | |
| import 'package:dot/utils/SharedPref.dart'; | |
| import 'package:dot/utils/Util.dart'; | |
| import 'package:dot/utils/popUp.dart'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:http/http.dart' as http; |
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
| //taskData is list to show in listView | |
| void _sortTaskData({bool reversed: false}) { | |
| taskData.sort((a, b) { | |
| return a.compareTo(b); | |
| }); | |
| if (reversed) { | |
| taskData = taskData.reversed.toList(); | |
| } | |
| setState(() {}); |
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.annotation.SuppressLint; | |
| import android.content.ContentUris; | |
| import android.content.Context; | |
| import android.content.CursorLoader; | |
| import android.database.Cursor; | |
| import android.net.Uri; | |
| import android.os.Build; | |
| import android.os.Environment; | |
| import android.provider.DocumentsContract; | |
| import android.provider.MediaStore; |