Skip to content

Instantly share code, notes, and snippets.

Avatar

Harish Sridharan sharish

View GitHub Profile
View BitmapMergeCenterUsage.java
int angle = 90; // your angle here
float scale = 0.5f; // scaling option for merging the image
Bitmap baseBitmap; // your base bitmap here
Bitmap mergeBitmap; // your merging bitmap here
ImageView imgView; // your image view for displaying the merged bitmaps.
BitmapMergerTask task = new BitmapMergerTask();
task.setBaseBitmap(baseBitmap)
.setMergeBitmap(mergeBitmap)
.setMergeListener(new BitmapMergerTask.OnMergeListener() {
@Override
View BitmapMergerTopLeft.java
int leftOffset = 0; // your left offset in pixels
int topOffset = 0; // your top offset in pixels
float scale = 0.5f; // scaling option for merging the image
Bitmap baseBitmap; // your base bitmap here
Bitmap mergeBitmap; // your merging bitmap here
ImageView imgView; // your image view for displaying the merged bitmaps.
BitmapMergerTask task = new BitmapMergerTask();
task.setBaseBitmap(baseBitmap)
.setMergeBitmap(mergeBitmap)
.setMergeListener(new BitmapMergerTask.OnMergeListener() {
View BitmapMergerAngle.java
int angle = 90; // your angle here
float scale = 0.5f; // scaling option for merging the image
Bitmap baseBitmap; // your base bitmap here
Bitmap mergeBitmap; // your merging bitmap here
ImageView imgView; // your image view for displaying the merged bitmaps.
BitmapMergerTask task = new BitmapMergerTask();
task.setBaseBitmap(baseBitmap)
.setMergeBitmap(mergeBitmap)
.setMergeListener(new BitmapMergerTask.OnMergeListener() {
@Override
View .travis.yml
language: android
jdk:
- oraclejdk7
- oraclejdk8
android:
components:
- build-tools-22.0.1
- android-22
- extra-android-support
- extra-android-m2repository
View ColorShades.java
package com.cooltechworks.materialcolorshades;
import android.graphics.Color;
/**
* Created by sharish on 02/07/15.
*/
/**
View OnDownListener.java
package com.cooltechworks.ondownsample;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by sharish on 7/24/15.
*/
public abstract class OnDownListener implements View.OnTouchListener {
View OnDownUsage.java
package com.cooltechworks.ondownsample;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
View OnDownUsageMainActivityLayout.xml
<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">
<View
android:id="@+id/hello"
android:layout_width="150dp"
android:layout_height="150dp"
View ColorShadesUsage.java
package com.cooltechworks.materialcolorshades;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
View ColorShadesUsageLayout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="@color/blue_bg"
android:orientation="vertical">
<TextView
android:id="@+id/output_color_code"
android:layout_width="match_parent"
You can’t perform that action at this time.