Commit 1d816306 authored by Krishna Bhilare's avatar Krishna Bhilare

Initial commit

parents
Pipeline #40 failed with stages
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
ext.versionMajor = 1
ext.versionMinor = 1
ext.versionPatch = 4
ext.minSdkVersion = 21
android {
compileSdkVersion 28
defaultConfig {
applicationId "ibase.android.visionselfie"
minSdkVersion 21
targetSdkVersion 28
versionCode generateVersionCode()//1 //210010000
versionName generateVersionName()//"1.0"//1.0.0"1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
private Integer generateVersionCode() {
return ext.minSdkVersion * 10000000 + ext.versionMajor * 10000 + ext.versionMinor * 100 + ext.versionPatch
}
private String generateVersionName() {
String versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
return versionName
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//Support Design Library
implementation 'com.android.support:design:28.0.0'
//glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
// implementation 'com.android.support:exifinterface:28.0.0'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package ibase.android.visionselfie;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("ibase.android.visionselfie", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="ibase.android.visionselfie">
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".SampleActivity">
<intent-filter
android:autoVerify="true"
tools:targetApi="m">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="proteusvision.com"
android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter> <!-- Define your supported deeplinks -->
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<meta-data
android:name="com.google.android.actions"
android:resource="@xml/actions" />
</application>
</manifest>
\ No newline at end of file
package ibase.android.visionselfie;
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 {
private static final String TAG = "AutoFitTextureView";
private int mRatioWidth = 0;
private int mRatioHeight = 0;
private int mScreenWidth = 0;
private int mScreenHeight = 0;
public AutoFitTextureView(Context context) {
this(context, null);
}
public AutoFitTextureView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public AutoFitTextureView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public AutoFitTextureView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
/**
* Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
* calculated from the parameters. Note that the actual sizes of parameters don't matter, that
* is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
*
* @param width Relative horizontal size
* @param height Relative vertical size
*/
// public void setAspectRatio(int width, int height, int screenWidth, int screenHeight) {
public void setAspectRatio(int width, int height) {
if (width < 0 || height < 0) {
throw new IllegalArgumentException("Size cannot be negative.");
}
mRatioWidth = width;
mRatioHeight = height;
requestLayout();
// mScreenWidth = screenWidth;
// mScreenHeight = screenHeight;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// final int width = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
// final int height = resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
if (0 == mRatioWidth || 0 == mRatioHeight) {
setMeasuredDimension(width, height);
} else {
if (width < height * mRatioWidth / mRatioHeight) {
setMeasuredDimension(width, width * mRatioHeight / mRatioWidth);
} else {
setMeasuredDimension(height * mRatioWidth / mRatioHeight, height);
}
}
// setMeasuredDimension(mScreenWidth,mScreenHeight);
}
}
package ibase.android.visionselfie;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import java.util.ArrayList;
public class DrawableImageView extends AppCompatImageView {
private static final String TAG = "DrawableImageView";
private static final int STICKER_STARTING_WIDTH = 300;
private static final int STICKER_STARTING_HEIGHT = 300;
private static final int MIN_STICKER_WIDTH = 50;
private static final int MIN_STICKER_HEIGHT = 50;
private Activity mHostActivity;
// Stickers
private ArrayList<Sticker> mStickers = new ArrayList<>();
private class Sticker {
Paint paint;
Bitmap bitmap;
Drawable drawable;
int x, y;
Rect rect;
Sticker(Bitmap bitmap, Drawable drawable, int x, int y) {
paint = new Paint();
this.x = x;
this.y = y;
this.bitmap = bitmap;
this.drawable = drawable;
// rect = new Rect(x, y, x + STICKER_STARTING_WIDTH, y + STICKER_STARTING_HEIGHT);
rect = new Rect(x, y, x + 1080, y + 1920);
}
}
public DrawableImageView(Context context) {
super(context);
init(context);
}
public DrawableImageView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public DrawableImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void init(Context context) {
Log.d(TAG, "init: ");
// setWillNotDraw(false);
setDrawingCacheEnabled(true);
if (context instanceof Activity) {
mHostActivity = (Activity) context;
}
}
public void reset() {
mStickers.clear();
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Log.d(TAG, "onDraw: ");
if (mStickers.size() > 0) {
for (Sticker sticker : mStickers) {
Log.d(TAG, "onDraw: ");
// Rect frameToDraw = new Rect(0, 0, 1000, 1000);
Rect frameToDraw = new Rect();
// RectF whereToDraw = new RectF(0, 0, 200, 200);
canvas.getClipBounds(frameToDraw); // get canvas size base screen size
// canvas.drawBitmap(sticker.bitmap, new Rect(0,0,40,40), new Rect(0,0,24,13) , null);
canvas.drawBitmap(sticker.bitmap, null, frameToDraw,null);
// canvas.drawBitmap(sticker.bitmap, sticker.x, sticker.y, sticker.paint);
// canvas.drawBitmap(scaleToActualAspectRatio(sticker.bitmap), sticker.x, sticker.y, sticker.paint);
}
}
}
public void addNewSticker(Drawable drawable) {
if (mHostActivity != null) {
if (mHostActivity instanceof MainActivity) {
Log.d(TAG, "addNewSticker: adding new sticker to canvas.");
Log.d(TAG, "addNewSticker: drawable: " + drawable);
Bitmap newStickerBitmap = drawableToBitmap(drawable);
Log.d(TAG, "addNewSticker: newStickerBitmap:Width " + newStickerBitmap.getWidth() + " Height " + newStickerBitmap.getHeight());
// Sticker sticker = new Sticker(newStickerBitmap, drawable, 0, 200);
DisplayMetrics displayMetrics = new DisplayMetrics();
// getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
int leftPercentage = width * 60 / 100;
int bottomPercentage = height * 60 / 100;
Log.d(TAG, "addNewSticker: height: " + height + " width : " + width);
Log.d(TAG, "addNewSticker: leftPercentage: "+leftPercentage+" bottomPercentage: "+bottomPercentage);
Sticker sticker = new Sticker(newStickerBitmap, drawable, 0, 0);
mStickers.add(sticker);
invalidate();
}
}
}
public static Bitmap drawableToBitmap(Drawable drawable) {
Bitmap bitmap = null;
if (drawable instanceof BitmapDrawable) {
Log.d(TAG, "drawableToBitmap: ");
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
if (bitmapDrawable.getBitmap() != null) {
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), STICKER_STARTING_WIDTH, STICKER_STARTING_HEIGHT, false);
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), (drawable.getIntrinsicWidth() / 2), (drawable.getIntrinsicHeight()/2), false);
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), (drawable.getIntrinsicWidth() / 4), (drawable.getIntrinsicHeight()/4), false);
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), 1080,1776, false);
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), 800,1232, false);
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), drawable.getIntrinsicWidth() , drawable.getIntrinsicHeight(), false);
// return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), drawable.getMinimumWidth() , drawable.getMinimumHeight(), false);
return Bitmap.createScaledBitmap(bitmapDrawable.getBitmap(), 1080 , 1920, false);
}
}
if (drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {
bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); // Single color bitmap will be created of 1x1 pixel
Log.d(TAG, "drawableToBitmap: if ");
} else {
// bitmap = Bitmap.createBitmap(STICKER_STARTING_WIDTH, STICKER_STARTING_WIDTH, Bitmap.Config.ARGB_8888);
// bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
bitmap = Bitmap.createBitmap(1080, 1920, Bitmap.Config.ARGB_8888);
Log.d(TAG, "drawableToBitmap: else ");
}
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
drawable.draw(canvas);
return bitmap;
}
public Bitmap scaleToActualAspectRatio(Bitmap bitmap) {
Log.d(TAG, "scaleToActualAspectRatio: ");
if (bitmap != null) {
boolean flag = true;
int deviceWidth = mHostActivity.getWindowManager().getDefaultDisplay()
.getWidth();
int deviceHeight = mHostActivity.getWindowManager().getDefaultDisplay()
.getHeight();
int bitmapHeight = bitmap.getHeight();
int bitmapWidth = bitmap.getWidth();
if (bitmapWidth > deviceWidth) {
flag = false;
// scale According to WIDTH
int scaledWidth = deviceWidth;
int scaledHeight = (scaledWidth * bitmapHeight) / bitmapWidth;
try {
if (scaledHeight > deviceHeight)
scaledHeight = deviceHeight;
bitmap = Bitmap.createScaledBitmap(bitmap, scaledWidth,
scaledHeight, true);
} catch (Exception e) {
e.printStackTrace();
}
}
if (flag) {
if (bitmapHeight > deviceHeight) {
// scale According to HEIGHT
int scaledHeight = deviceHeight;
int scaledWidth = (scaledHeight * bitmapWidth) / bitmapHeight;
try {
if (scaledWidth > deviceWidth)
scaledWidth = deviceWidth;
bitmap = Bitmap.createScaledBitmap(bitmap, scaledWidth,
scaledHeight, true);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return bitmap;
}
}
package ibase.android.visionselfie;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;
@GlideModule
public class GlideAppModuleClass extends AppGlideModule {
}
package ibase.android.visionselfie;
public interface ICallBack {
void done(Exception e);
}
package ibase.android.visionselfie;
import android.graphics.drawable.Drawable;
public interface IMainActivity {
void setCameraFrontFacing();
void setCameraBackFacing();
boolean isCameraFrontFacing();
boolean isCameraBackFacing();
void setFrontCameraId(String cameraId);
void setBackCameraId(String cameraId);
String getFrontCameraId();
String getBackCameraId();
void hideStatusBar();
void showStatusBar();
void hideStillShotWidgets();
void showStillShotWidgets();
void toggleViewStickersFragment();
void addSticker(Drawable sticker);
}
package ibase.android.visionselfie;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
public class ImageNicer {
public static int calculateInSampleSize(
BitmapFactory.Options options, int reqWidth, int reqHeight) {
// Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;
if (height > reqHeight || width > reqWidth) {
final int halfHeight = height / 2;
final int halfWidth = width / 2;
// Calculate the largest inSampleSize value that is a power of 2 and keeps both
// height and width larger than the requested height and width.
while ((halfHeight / inSampleSize) >= reqHeight
&& (halfWidth / inSampleSize) >= reqWidth) {
inSampleSize *= 2;
}
}
return inSampleSize;
}
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId,
int reqWidth, int reqHeight) {
// First decode with inJustDecodeBounds=true to check dimensions
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(res, resId, options);
// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;
return BitmapFactory.decodeResource(res, resId, options);
}
}
package ibase.android.visionselfie;
public class Item {
private int image;
public Item(int image) {
this.image = image;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
}
This diff is collapsed.
package ibase.android.visionselfie;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class SampleActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
/*Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();*/
}
}
\ No newline at end of file
package ibase.android.visionselfie;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import java.util.ArrayList;
public class StickerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final String TAG = "StickerAdapter";
private ArrayList<Drawable> mStickers = new ArrayList<>();
private ArrayList<Item> items;
private RecyclerViewClickListener clickListener;
private Context context;
public StickerAdapter(ArrayList<Item> items, RecyclerViewClickListener clickListener, Context context) {
this.items = items;
this.clickListener = clickListener;
this.context = context;
}
public StickerAdapter(Context context, ArrayList<Drawable> mStickers, RecyclerViewClickListener clickListener) {
this.mStickers = mStickers;
this.clickListener = clickListener;
this.context = context;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.layout_sticker_list_item, viewGroup, false);
ViewHolder viewHolder = new ViewHolder(view, clickListener);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
ImageView imageView = viewHolder.itemView.findViewById(R.id.iv_sticker_list_item);
RequestOptions requestOptions = new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.dontTransform()
.centerCrop();
// GlideApp.with(context)
Glide.with(context)
// .setDefaultRequestOptions(requestOptions)
// .load(mStickers.get(i))
.load(items.get(i).getImage())
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.mipmap.ic_launcher)
.into(imageView);
/* Glide.with(context)
.load(ImageNicer.decodeSampledBitmapFromResource(context.getResources(),R.id.iv_sticker_list_item,100,100))
.into(imageView);*/
// .into(((ViewHolder) viewHolder).imageView);
// .load(ImageNicer.decodeSampledBitmapFromResource(context.getResources(),mStickers.get(i),100,100))
// imageView.setImageBitmap(ImageNicer.decodeSampledBitmapFromResource(context.getResources(),mStickers,100,100));
/*Glide.with(context)
.load(mStickers.get(i))
.diskCacheStrategy(DiskCacheStrategy.ALL)
.skipMemoryCache(true)
.thumbnail(0.1f)
.into(((ViewHolder) viewHolder).imageView);
// .load(ImageNicer.decodeSampledBitmapFromResource(context.getResources(),mStickers.get(i),100,100))*/
}
@Override
public int getItemCount()
{
return items.size();
// return mStickers.size();
}
// public RecyclerView.ViewHolder
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
ImageView imageView;
RecyclerViewClickListener clickListener;
public ViewHolder(@NonNull View itemView, RecyclerViewClickListener clickListener) {
super(itemView);
imageView = itemView.findViewById(R.id.iv_sticker_list_item);
this.clickListener = clickListener;
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if (clickListener != null) {
Log.d(TAG, "onClick: ");
clickListener.onStickerClicked(getAdapterPosition());
}
}
}
public interface RecyclerViewClickListener {
void onStickerClicked(int position);
}
}
package ibase.android.visionselfie;
import android.util.Size;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Utility {
/**
* Compares two {@code Size}s based on their areas.
*/
static class CompareSizesByArea implements Comparator<Size> {
public static CompareSizesByArea newInstance(){
return new CompareSizesByArea();
}
@Override
public int compare(Size lhs, Size rhs) {
// We cast here to ensure the multiplications won't overflow
return Long.signum((long) lhs.getWidth() * lhs.getHeight() -
(long) rhs.getWidth() * rhs.getHeight());
}
}
/**
* Given {@code choices} of {@code Size}s supported by a camera, choose the smallest one that
* is at least as large as the respective texture view size, and that is at most as large as the
* respective max size, and whose aspect ratio matches with the specified value. If such size
* doesn't exist, choose the largest one that is at most as large as the respective max size,
* and whose aspect ratio matches with the specified value.
*
* @param choices The list of sizes that the camera supports for the intended output
* class
* @param textureViewWidth The width of the texture view relative to sensor coordinate
* @param textureViewHeight The height of the texture view relative to sensor coordinate
* @param maxWidth The maximum width that can be chosen
* @param maxHeight The maximum height that can be chosen
* @param aspectRatio The aspect ratio
* @return The optimal {@code Size}, or an arbitrary one if none were big enough
*/
static Size chooseOptimalSize(Size[] choices, int textureViewWidth,
int textureViewHeight, int maxWidth, int maxHeight, Size aspectRatio) {
// Collect the supported resolutions that are at least as big as the preview Surface
List<Size> bigEnough = new ArrayList<>();
// Collect the supported resolutions that are smaller than the preview Surface
List<Size> notBigEnough = new ArrayList<>();
int w = aspectRatio.getWidth();
int h = aspectRatio.getHeight();
for (Size option : choices) {
// Log.d(TAG, "chooseOptimalSize: w: " + option.getWidth() + ", h: " + option.getHeight());
if (option.getWidth() <= maxWidth && option.getHeight() <= maxHeight &&
option.getHeight() == option.getWidth() * h / w) {
if (option.getWidth() >= textureViewWidth &&
option.getHeight() >= textureViewHeight) {
bigEnough.add(option);
} else {
notBigEnough.add(option);
}
}
}
// Pick the smallest of those big enough. If there is no one big enough, pick the
// largest of those not big enough.
if (bigEnough.size() > 0) {
return Collections.min(bigEnough, new CompareSizesByArea());
} else if (notBigEnough.size() > 0) {
return Collections.max(notBigEnough, new CompareSizesByArea());
} else {
return choices[0];
}
}
}
package ibase.android.visionselfie;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class ViewStickersFragment extends Fragment implements View.OnClickListener, StickerAdapter.RecyclerViewClickListener {
private static final String TAG = "ViewStickersFragment";
public static final int NUM_OF_COLUMN = 1;
private RecyclerView mRecyclerView;
private ArrayList<Item> items;
private ArrayList<Drawable> mStickers = new ArrayList<>();
private IMainActivity mIMainActivity;
private StickerAdapter mStickerAdapter;
public static ViewStickersFragment newInstance() {
return new ViewStickersFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_view_stickers, container, false);
view.findViewById(R.id.init_sticker_icon).setOnClickListener(this);
mRecyclerView = view.findViewById(R.id.recycler_view);
items = new ArrayList<>();
initRecyclerView();
// getStickers();
getStickersNew();
return view;
}
private void getStickersNew() {
int images[] = {
// R.drawable.ic_great_place,
/*R.drawable.a_great_place_frame,
R.drawable.b_smartwork_not_hard_frame,
R.drawable.c_we_love_proteus_frame,
R.drawable.d_small_team_doing_big_things_frame*/
// R.drawable.ac_we_love_proteus_frame,
R.drawable.aa_fun_at_proteus,
R.drawable.ab_great_place_to_work,
R.drawable.we_love_proteus_frame,
R.drawable.great_placeto_work_frame,
R.drawable.ad_work_smart_not_hard,
R.drawable.i_love_base_blue_frame,
R.drawable.i_love_base_white_frame
};
int i = 0;
while (i < images.length) {
items.add(new Item(images[i]));
i++;
}
mRecyclerView.setAdapter(new StickerAdapter(items,this,getActivity()));
}
private void initRecyclerView() {
if (mStickerAdapter == null) {
// mStickerAdapter = new StickerAdapter(getActivity(), mStickers, this);
mStickerAdapter = new StickerAdapter(items,this,getActivity());
}
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), NUM_OF_COLUMN));
mRecyclerView.setAdapter(mStickerAdapter);
mStickerAdapter.notifyDataSetChanged();
}
private void getStickers() {
if (getActivity() != null) {
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfieapp_sicker_01));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfieapp_sicker_0200));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfieapp_sicker_03));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfieapp_sicker_01));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_app02));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.a1));
/* mStickers.add(getActivity().getResources().getDrawable(R.drawable.a2));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.ic_great_place));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker2));*/
/*thumbnails*/
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.a_great_place_thumb));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.b_smartwork_not_hard_thumb));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.c_we_love_proteus_frame_thumb));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.d_fun_at_proteus_thumb));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.e_i_love_base_blue_thumb));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.f_we_love_proteus_frame_thumb));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.a_great_place_frame));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.b_smartwork_not_hard_frame));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.c_we_love_proteus_frame));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker2));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker2));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.ic_small_team_doing_big_things));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.small_team_doing_big_things));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.work_smart_not_hard));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.ic_work_smart_not_hard));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfie_sticker1));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.selfisti));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.ic_vision_selfie_app_one));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.ic_vision_selfie_app_two));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.slightly_smiling_face_emoji));
/* mStickers.add(getActivity().getResources().getDrawable(R.drawable.smiley_face_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.smiley_smiling_eyes_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.smiley_face_tightly_closed_eyes_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.smiley_with_sweat_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.tears_of_joy_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.sunglasses_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.nerd_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.smirking_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.unamused_emoji));
mStickers.add(getActivity().getResources().getDrawable(R.drawable.penguin_emoji));*/
/**/
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.upside_down_face_emoji));
// mStickers.add(getActivity().getResources().getDrawable(R.drawable.sad_emoji));
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.init_sticker_icon: {
mIMainActivity.toggleViewStickersFragment();
break;
}
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
try {
mIMainActivity = (IMainActivity) getActivity();
} catch (Exception e) {
Log.e(TAG, "onAttach: " + e.getMessage());
}
}
@Override
public void onStickerClicked(int position) {
// mIMainActivity.addSticker(mStickers.get(position));
mIMainActivity.addSticker(getResources().getDrawable(items.get(position).getImage()));
mIMainActivity.toggleViewStickersFragment();
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="-100%" android:toYDelta="0%" android:duration="200"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromYDelta="0%p"
android:toYDelta="100%p" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromYDelta="100%p"
android:toYDelta="0%p" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="@android:integer/config_shortAnimTime"
android:fromXDelta="0"
android:toYDelta="-100%" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="@android:integer/config_shortAnimTime"
android:fromXDelta="0"
android:toYDelta="100%" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%" android:toYDelta="-100%" android:duration="100"/>
</set>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#000000">
<path
android:fillColor="#FF000000"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#cc0000">
<item android:id="@android:id/mask">
<shape android:shape="oval">
<corners android:radius="50dp" />
<solid android:color="#cc0000" />
</shape>
</item>
</ripple>
<!--
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#cc0000">
<item android:id="@android:id/mask">
<shape android:shape="oval">
<solid android:color="#cc0000" />
</shape>
</item>
</ripple>-->
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/darkGrey">
<item android:id="@android:id/mask">
<shape android:shape="oval">
<solid android:color="@color/darkGrey" />
</shape>
</item>
</ripple>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke android:width="1dp" android:color="#000" />
<!--<solid android:color="#fff" />-->
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="1dp"
android:color="#111" />
<!--<solid android:color="#11aaaaaa" />-->
<solid android:color="#3F51B5" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke android:width="1dp" android:color="@android:color/black" />
<solid android:color="@color/darkTransparentGrey" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke android:width="1dp" android:color="#000" />
<solid android:color="#fff" />
</shape>
</item>
</layer-list>
This diff is collapsed.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M9.4,10.5l4.77,-8.26C13.47,2.09 12.75,2 12,2c-2.4,0 -4.6,0.85 -6.32,2.25l3.66,6.35 0.06,-0.1zM21.54,9c-0.92,-2.92 -3.15,-5.26 -6,-6.34L11.88,9h9.66zM21.8,10h-7.49l0.29,0.5 4.76,8.25C21,16.97 22,14.61 22,12c0,-0.69 -0.07,-1.35 -0.2,-2zM8.54,12l-3.9,-6.75C3.01,7.03 2,9.39 2,12c0,0.69 0.07,1.35 0.2,2h7.49l-1.15,-2zM2.46,15c0.92,2.92 3.15,5.26 6,6.34L12.12,15L2.46,15zM13.73,15l-3.9,6.76c0.7,0.15 1.42,0.24 2.17,0.24 2.4,0 4.6,-0.85 6.32,-2.25l-3.66,-6.35 -0.93,1.6z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:fillColor="#666"
android:pathData="M23.71,11.71l-8,8a1,1 0,0 1,-1.42 0l-8,-8a1,1 0,0 1,-0.21 -1.09A1,1 0,0 1,7 10H23a1,1 0,0 1,0.92 0.62A1,1 0,0 1,23.71 11.71Z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
</vector>
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:tint="#E83CF7"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,4h7L11,2L4,2c-1.1,0 -2,0.9 -2,2v7h2L4,4zM10,13l-4,5h12l-3,-4 -2.03,2.71L10,13zM17,8.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S14,7.67 14,8.5s0.67,1.5 1.5,1.5S17,9.33 17,8.5zM20,2h-7v2h7v7h2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,20h-7v2h7c1.1,0 2,-0.9 2,-2v-7h-2v7zM4,13L2,13v7c0,1.1 0.9,2 2,2h7v-2L4,20v-7z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#e83cf7"
android:pathData="M20,4h-3.17L15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM15,15.5L15,13L9,13v2.5L5.5,12 9,8.5L9,11h6L15,8.5l3.5,3.5 -3.5,3.5z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,4h-3.17L15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM15,15.5L15,13L9,13v2.5L5.5,12 9,8.5L9,11h6L15,8.5l3.5,3.5 -3.5,3.5z" />
</vector>
<?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"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/camera_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".SampleActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="OnDeepLinking" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/parent_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CameraFragment">
<!--android:background="#03A9F4"-->
<ibase.android.visionselfie.AutoFitTextureView
android:id="@+id/texture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ibase.android.visionselfie.DrawableImageView
android:id="@+id/stillshot_imageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--android:background="@drawable/circle_opaque"-->
<View
android:id="@+id/view_stillshot_bg"
android:layout_width="61dp"
android:layout_height="61dp"
android:background="@drawable/circle_white"
app:layout_constraintBottom_toBottomOf="@+id/stillshot"
app:layout_constraintEnd_toEndOf="@+id/stillshot"
app:layout_constraintStart_toStartOf="@+id/stillshot"
app:layout_constraintTop_toTopOf="@+id/stillshot" />
<ImageButton
android:id="@+id/stillshot"
style="@android:style/Widget.Material.Light.Button.Borderless"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="24dp"
android:background="@drawable/cam_circle_selector"
android:keepScreenOn="true"
android:src="@drawable/ic_photo_camera_pink_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--android:src="@drawable/ic_camera_white"-->
<View
android:id="@+id/view_orientation_bg"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/circle_white"
app:layout_constraintBottom_toBottomOf="@+id/stillshot"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/stillshot"
app:layout_constraintTop_toTopOf="@+id/stillshot" />
<ImageButton
android:id="@+id/switch_orientation"
style="@android:style/Widget.Material.Light.Button.Borderless"
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/cam_grey_circle_selector"
android:padding="1dp"
android:src="@drawable/ic_switch_camera_black_24dp"
app:layout_constraintBottom_toBottomOf="@+id/view_orientation_bg"
app:layout_constraintEnd_toEndOf="@+id/view_orientation_bg"
app:layout_constraintStart_toStartOf="@+id/view_orientation_bg"
app:layout_constraintTop_toTopOf="@+id/view_orientation_bg" />
<!--<ImageView
android:id="@+id/stillshot_imageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />-->
<View
android:id="@+id/view_orientation_bg_close"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/circle_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_close_stillshot_view"
android:layout_width="40dp"
android:layout_height="40dp"
android:keepScreenOn="true"
android:padding="12dp"
android:src="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="@+id/view_orientation_bg_close"
app:layout_constraintEnd_toEndOf="@+id/view_orientation_bg_close"
app:layout_constraintStart_toStartOf="@+id/view_orientation_bg_close"
app:layout_constraintTop_toTopOf="@+id/view_orientation_bg_close" />
<View
android:id="@+id/view_orientation_bg_save"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="16dp"
android:background="@drawable/circle_white"
app:layout_constraintBottom_toBottomOf="@+id/stillshot"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/stillshot" />
<ImageButton
android:id="@+id/ibtn_save"
style="@android:style/Widget.Material.Light.Button.Borderless"
android:layout_width="44dp"
android:layout_height="44dp"
android:src="@drawable/ic_save_black_24dp"
app:layout_constraintBottom_toBottomOf="@+id/view_orientation_bg_save"
app:layout_constraintEnd_toEndOf="@+id/view_orientation_bg_save"
app:layout_constraintStart_toStartOf="@+id/view_orientation_bg_save"
app:layout_constraintTop_toTopOf="@+id/view_orientation_bg_save" />
<View
android:id="@+id/view_orientation_bg_sticker_icon"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="85dp"
android:layout_marginEnd="8dp"
android:background="@drawable/circle_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/stillshot_imageview" />
<ImageButton
android:id="@+id/init_sticker_icon"
style="@android:style/Widget.Material.Light.Button.Borderless"
android:layout_width="44dp"
android:layout_height="44dp"
android:src="@drawable/ic_sticker_small"
app:layout_constraintBottom_toBottomOf="@+id/view_orientation_bg_sticker_icon"
app:layout_constraintEnd_toEndOf="@+id/view_orientation_bg_sticker_icon"
app:layout_constraintStart_toStartOf="@+id/view_orientation_bg_sticker_icon"
app:layout_constraintTop_toTopOf="@+id/view_orientation_bg_sticker_icon" />
<View
android:id="@+id/view_orientation_bg_share"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/circle_white"
app:layout_constraintBottom_toTopOf="@+id/ibtn_save"
app:layout_constraintEnd_toEndOf="@+id/view_orientation_bg_save"
app:layout_constraintStart_toStartOf="@+id/ibtn_save" />
<ImageButton
android:id="@+id/ibtn_share"
style="@android:style/Widget.Material.Light.Button.Borderless"
android:layout_width="44dp"
android:layout_height="44dp"
android:src="@drawable/ic_share_black_24dp"
app:layout_constraintBottom_toBottomOf="@+id/view_orientation_bg_share"
app:layout_constraintEnd_toEndOf="@+id/view_orientation_bg_share"
app:layout_constraintStart_toStartOf="@+id/view_orientation_bg_share"
app:layout_constraintTop_toTopOf="@+id/view_orientation_bg_share" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<!--android:background="@color/darkTransparentGrey"-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="@+id/sticker_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="85dp"
android:layout_marginRight="8dp"
android:animateLayoutChanges="true"
android:background="@drawable/circle_white"
android:padding="1dp">
<ImageButton
android:id="@+id/init_sticker_icon"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:background="@drawable/circle_white"
android:padding="10dp"
android:scaleType="fitXY"
android:src="@drawable/ic_close"
tools:ignore="ContentDescription" />
<!--android:src="@drawable/ic_sticker_small"-->
</RelativeLayout>
</RelativeLayout>
<!--android:layout_marginTop="?attr/actionBarSize"-->
<!--android:layout_marginTop="130dp"-->
<!--android:background="@color/darkTransparentGrey"-->
<android.support.v7.widget.RecyclerView
android:paddingLeft="4dp"
android:layout_marginRight="8dp"
android:layout_gravity="right"
android:id="@+id/recycler_view"
android:layout_width="50dp"
android:layout_height="400dp">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/circle_shape_new"
android:padding="2dp">
<ImageView
android:id="@+id/iv_sticker_list_item"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<!--app:srcCompat="@drawable/smiley_face_tightly_closed_eyes_emoji" />-->
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">never</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="White">#fff</color>
<color name="darkGrey">#a6a6a6 </color>
<color name="Grey">#c3c3c3 </color>
<color name="lightGrey">#f2f2f2 </color>
<color name="transparentGrey">#21737373 </color>
<color name="darkTransparentGrey">#a0737373 </color>
<color name="DarkGrey">#737373 </color>
<color name="Black">#000 </color>
</resources>
<resources>
<string name="app_name">Vision Moments</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<!-- fragment tags -->
<string name="fragment_camera2">Camera2</string>
<string name="request_permission">Need Camera Permission</string>
<string name="camera_error">This device doesn\'t support Camera2 API.</string>
<string name="view_stickers">View Stickers</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
<!--<item name="android:windowFullscreen">true</item>-->
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<actions>
<!-- This file describes the supported actions by this app -->
<action intentName="android.intent.action.VIEW">
<!-- Each action requires at least one fulfillment that defines how the app will handle this action -->
<!-- Define the urlTemplate in the format you define your deeplinks in AndroidManifest.xml -->
<fulfillment urlTemplate="https://proteusvision.com/start{?type}">
<!-- Define how the actions parameters (intentParameter) is mapped in the urlTemplate above -->
<parameter-mapping
intentParameter="parameter.name"
urlParameter="type" />
</fulfillment>
<!-- Map a parameter to an entity set reference -->
<parameter name="parameter.name">
<entity-set-reference entitySetId="VisionEntitySet" />
</parameter>
</action>
<!-- Define an inline inventory -->
<!-- This sample maps supported entities with the class Activity.Type -->
<entity-set entitySetId="VisionEntitySet">
<entity
name="image capturing"
identifier="CAPTURE" />
</entity-set>
</actions>
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>
\ No newline at end of file
package ibase.android.visionselfie;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Tue May 28 10:48:49 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment