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
| package com.package_name; | |
| import android.annotation.SuppressLint; | |
| import android.content.Context; | |
| import android.os.Handler; | |
| import android.util.AttributeSet; | |
| import android.widget.TextView; | |
| @SuppressLint("AppCompatCustomView") | |
| public class TypeWriter extends TextView { |
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 popupImage(context: Context, photo: Drawable) { | |
| val popup = ImagePopup(context as Activity) | |
| popup.initiatePopup(photo) | |
| popup.isFullScreen = false | |
| popup.isHideCloseIcon = false | |
| popup.setBackgroundColor(Color.parseColor("#000000")) | |
| popup.setOnImageClickListener { | |
| popup.dismiss() | |
| popup.isFullScreen = !popup.isFullScreen |
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
| package com.intertech.e_bike_bethlehem.network.retrofit | |
| import android.content.Context | |
| import com.google.gson.Gson | |
| import com.google.gson.GsonBuilder | |
| import com.intertech.e_bike_bethlehem.R | |
| import okhttp3.OkHttpClient | |
| import okhttp3.logging.HttpLoggingInterceptor | |
| import retrofit2.Retrofit | |
| import retrofit2.converter.gson.GsonConverterFactory |
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 fun onBackPressed() { | |
| if (backPressedTime + 2000 > System.currentTimeMillis()) { | |
| backToasty!!.cancel() | |
| super.onBackPressed() | |
| return | |
| } else { | |
| backToasty = Toast.makeText(this, getString(R.string.back_exit), Toast.LENGTH_SHORT) | |
| backToasty!!.show() | |
| } |
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 static void replaceFragment(Fragment fragment, @StringRes int title) { | |
| // binding.main.appbar.tvTool.setText(title); | |
| // FragmentManager manager = getSupportFragmentManager(); | |
| FragmentManager manager = ((FragmentActivity) context).getSupportFragmentManager(); | |
| FragmentTransaction transaction = manager.beginTransaction(); | |
| transaction.replace(R.id.main_nav_host_fragment, fragment); | |
| transaction.addToBackStack("TAG"); | |
| transaction.commit(); | |
| } |
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 android.widget.Toast backToasty; | |
| private long backPressedTime; | |
| @Override | |
| public void onBackPressed() { | |
| if (backPressedTime + 2000 > System.currentTimeMillis()) { | |
| backToasty.cancel(); | |
| super.onBackPressed(); | |
| return; | |
| } else { |
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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
| import android.content.Context; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import androidx.annotation.NonNull; | |
| import androidx.recyclerview.widget.RecyclerView; | |
| import java.util.ArrayList; |
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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
| import android.content.Context | |
| import android.view.LayoutInflater | |
| import android.view.ViewGroup | |
| import androidx.recyclerview.widget.RecyclerView | |
| class ${NAME}Adapter(val context: Context) : RecyclerView.Adapter<${NAME}Adapter.${NAME}ViewHolder>() { | |
| var list = emptyList<${Model_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
| package com.mrq.library.helpers | |
| import android.app.Dialog | |
| import android.os.Bundle | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import android.widget.FrameLayout | |
| import androidx.annotation.LayoutRes | |
| import androidx.databinding.DataBindingUtil |
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
| package com.mrq.library.helpers | |
| import android.app.Dialog | |
| import android.graphics.Color | |
| import android.graphics.drawable.ColorDrawable | |
| import android.os.Bundle | |
| import android.util.Log | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup |
NewerOlder