Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding

Akın akndmr

👨‍💻
Coding
  • Mobillium
View GitHub Profile
@akndmr
akndmr / CustomIndicator.kt
Last active Sep 16, 2021
Pager indicator
View CustomIndicator.kt
/**
* Created by Akın DEMİR on 24.10.2019.
*/
class CVCircleIndicator : LinearLayout {
private var mContext: Context? = null
private var mViewpager: ViewPager? = null
@akndmr
akndmr / IBAN_Regex.md
Created Apr 9, 2021
Global IBAN regex
View IBAN_Regex.md
const val IBAN_REGEX =  "^([A-Z]{2}[ '+'\\\\'+'-]?[0-9]{2})(?=(?:[ '+'\\\\'+'-]?[A-Z0-9]){9,30}\$)((?:[ '+'\\\\'+'-]?[A-Z0-9]{3,5}){2,7})([ '+'\\\\'+'-]?[A-Z0-9]{1,3})?\$"

Successfully tested against below IBAN samples.

Country(TR) Country Code Length
@akndmr
akndmr / Scale down drawable of EditText.java
Created Jun 26, 2019
Scale left/start, right/end, top, bottom drawables of EditText
View Scale down drawable of EditText.java
private Drawable getScaledDrawable(int drawableId){
Drawable drawable = getResources().getDrawable(drawableId);
drawable.setBounds(0, 0, (int) (drawable.getIntrinsicWidth() * 0.4),
(int) (drawable.getIntrinsicHeight() * 0.4));
return drawable;
}
/**
* Scale down left drawable
* android:drawableLeft="@drawable/myIcon"
@akndmr
akndmr / strings.xml
Last active Dec 25, 2018
Popvie App v2 Translation
View strings.xml
<resources>
<!-- App related -->
<string name="app_name" translatable="false">Popvie</string>
<string name="app_version">v2.0</string>
<string name="app_slogan">\"all about movie\"</string>
<string name="app_copyright" translatable="false">©2018</string>
<!-- Generel -->
<string name="no_internet_connection">There is no internet connection!</string>
<string name="permission_grant_rationale">You need to grant this permission to change the picture. After change you can cancel this permission from phone settings anytime.</string>
@akndmr
akndmr / mock_hotels_ayt
Created Sep 22, 2018
Mock hotels in Antalya
View mock_hotels_ayt
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "BWAYT020",
"chainCode": "BW",
"dupeId": "700003141",
"name": "BEST WESTERN PLUS KHAN HOTEL",
@akndmr
akndmr / mock_hotels_ist
Created Sep 22, 2018
Mock hotels in Istanbul - JSON
View mock_hotels_ist
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "WWISTTAK",
"chainCode": "WW",
"dupeId": "700013174",
"name": "POINT HOTEL TAKSIM",
@akndmr
akndmr / mock_hotels_ank
Created Sep 22, 2018
Mock hotels in Ankara - JSON
View mock_hotels_ank
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "HLANK243",
"chainCode": "HL",
"dupeId": "700035344",
"name": "ANKARA HILTONSA",
@akndmr
akndmr / XActivity.java
Created Mar 3, 2018
Popvie - Movie Activity
View XActivity.java
// Fetch a single movie by id
private void fetchMovieByID(int movieId) {
final Call<Movie> call = mService.getMovieWithId(movieId, BuildConfig.TMDB_API_KEY);
call.enqueue(new Callback<Movie>() {
@Override
public void onResponse(Call<Movie> call, Response<Movie> response) {
movie = response.body();
// Do sth with movie instance
// Like : movieTitleTextView.setText(movie.getTitle());
@akndmr
akndmr / response.json
Created Mar 3, 2018
Popvie - Example response for Fight Club
View response.json
{
"adult": false,
"backdrop_path": "/fCayJrkfRaCRCTh8GqN30f8oyQF.jpg",
"belongs_to_collection": null,
"budget": 63000000,
"genres": [
{
"id": 18,
"name": "Drama"
}