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.rajnit.photostudio.adapter; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.v4.view.PagerAdapter; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.pierfrancescosoffritti.androidyoutubeplayer.player.YouTubePlayer; |
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 CustomTypeFaceTextViewRegular extends TextView { | |
public TextViewRegular(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
applyCustomFont(context); | |
} | |
public TextViewRegular(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
applyCustomFont(context); | |
} |
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
import android.content.Context; | |
import android.media.MediaPlayer; | |
import android.net.Uri; | |
import java.io.IOException; | |
/** | |
* Created by rajnit on 10/07/17. | |
*/ |
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
import java.io.Serializable; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by rajnit on 22/08/17. | |
*/ | |
public class Category implements Serializable { |
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
import android.content.Context; | |
import android.content.Intent; | |
import android.support.v4.content.WakefulBroadcastReceiver; | |
import android.util.Log; | |
/** | |
* This is called whenever app receives notification | |
* in background/foreground state so you can | |
* apply logic for background task, but still Firebase notification | |
* will be shown in notification tray |
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 boolean dispatchTouchEvent(MotionEvent ev) { | |
View view = getCurrentFocus(); | |
if (view != null && (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_MOVE) && view instanceof EditText && !view.getClass().getName().startsWith("android.webkit.")) { | |
int scrcoords[] = new int[2]; | |
view.getLocationOnScreen(scrcoords); | |
float x = ev.getRawX() + view.getLeft() - scrcoords[0]; | |
float y = ev.getRawY() + view.getTop() - scrcoords[1]; | |
if (x < view.getLeft() || x > view.getRight() || y < view.getTop() || y > view.getBottom()) | |
((InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow((this.getWindow().getDecorView().getApplicationWindowToken()), 0); |