Skip to content

Commit

Permalink
removed files and geter setter
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitjain240595 committed Dec 28, 2019
1 parent d5a5377 commit eba6f65
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 180 deletions.
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".customView1.Main2Activity"></activity>
<activity android:name=".customview2.CustomView2"></activity>
<activity android:name=".customView1.MainActivity">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.app.trymosaic.customView1;
package com.app.trymosaic;

import android.app.Activity;
import android.graphics.Bitmap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package com.app.trymosaic.customView1;
package com.app.trymosaic;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.graphics.Color;
import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.Toast;

import com.app.trymosaic.R;
import com.app.trymosaic.customView1.Draw;
import com.app.trymosaic.databinding.ActivityMainBinding;
import com.matrixdev.mosaic.ItemChooseInterface;

Expand All @@ -19,9 +15,6 @@ public class MainActivity extends AppCompatActivity {


ActivityMainBinding binding;
private Draw draw;
private float mx, my;
private float curX, curY;
private ArrayList<DataModel> models;
private Runnable onImageLoad;

Expand All @@ -30,8 +23,6 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding= DataBindingUtil.setContentView(this, R.layout.activity_main);



initUI();
}

Expand Down
39 changes: 0 additions & 39 deletions app/src/main/java/com/app/trymosaic/customView1/Draw.java

This file was deleted.

28 changes: 0 additions & 28 deletions app/src/main/java/com/app/trymosaic/customView1/Keypaint.java

This file was deleted.

17 changes: 0 additions & 17 deletions app/src/main/java/com/app/trymosaic/customView1/Main2Activity.java

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".customView1.MainActivity">
tools:context=".MainActivity">

<com.matrixdev.mosaic.VScroll
android:background="@color/colorAccent"
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/layout/activity_main2.xml

This file was deleted.

82 changes: 9 additions & 73 deletions mosaic/src/main/java/com/matrixdev/mosaic/MosaicView.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,8 @@ public MosaicView(Context context, AttributeSet attrs) {
placeholder = createPlaceholder(dpToPx(100),dpToPx(100),Color.WHITE);

TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.MosaicView);
// draw = context.getResources().obtainTypedArray(R.array.random_imgs);
//
// bitmapObjectClasses.clear();
// for (int i = 0; i < draw.length(); i++) {
// Bitmap bitmap = BitmapFactory.decodeResource(getResources(), draw.getResourceId(i, -1));
// random = new Random().nextInt(70);
// Log.d("-----RANDOM", "" + random);
// bitmap = addRoundCorners(bitmap, random);
// BitmapObjectClass bitmapObjectClass = new BitmapObjectClass();
//
// bitmapObjectClass.setBitmap(bitmap);
// bitmapObjectClasses.add(bitmapObjectClass);
// }
//

attributes.recycle();
// totalCompanies = draw.length();
// draw.recycle();
}

public MosaicView(Context context, Drawable mCustomImage) {
Expand Down Expand Up @@ -337,63 +322,6 @@ public void onFinish() {
}
});


// touchHandler.setOnTouchListener(new OnTouchListener() {
// @Override
// public boolean onTouch(View view, MotionEvent motionEvent) {
// for (int i = 0; i < bitmapObjectClasses.size(); i++) {
// if (bitmapObjectClasses.get(i).getLeft() <= motionEvent.getX()+hscroll.getScrollX() &&
// bitmapObjectClasses.get(i).getRight() >= motionEvent.getX()+hscroll.getScrollX() &&
// bitmapObjectClasses.get(i).getTop() <= motionEvent.getY()+vScroll.getScrollY() &&
// bitmapObjectClasses.get(i).getBottom() >= motionEvent.getY()+vScroll.getScrollY()) {
// Log.d("Suuceess", "" + motionEvent.getAction());
// switch (motionEvent.getAction()) {
// case (MotionEvent.ACTION_DOWN):
// hscroll.setBlocked(true);
// vScroll.setBlocked(true);
// touchX = motionEvent.getX()+hscroll.getScrollX();
// touchY = motionEvent.getY()+vScroll.getScrollY();
// invalidate();
// Log.d("------", "Action was DOWN");
// }
// }
// }
//// switch (motionEvent.getAction()) {
//// case (MotionEvent.ACTION_MOVE):
//// if(touchX!=0) {
////
//// }else{
////// motionEvent.setLocation(motionEvent.getX()+hscroll.getScrollX(),motionEvent.getY()+vScroll.getScrollY());
//// }
//// break;
//// case (MotionEvent.ACTION_UP):
//// touchX = 0;
//// touchY = 0;
//// Log.d("-----ACTION_UP", "dssf");
//// invalidate();
//// case MotionEvent.ACTION_CANCEL:
//// touchX = 0;
//// touchY = 0;
//// Log.d("-----ACTION_CAncel", "cancel");
////// invalidate();
//// }
//// if(touchX!=0)
//
// Log.d("-----",""+motionEvent);
//// singleTapGesture.onTouchEvent(motionEvent);
//// motionEvent.setLocation(2654,2667);
// if(touchX!=0) {
// motionEvent.setLocation(motionEvent.getX()+hscroll.getScrollX(),motionEvent.getY()+vScroll.getScrollY());
// return true;
// }else {
//// hscroll.setBlocked(false);
//// vScroll.setBlocked(false);
// return false;
// }
// }
// });


}

public static Bitmap createPlaceholder(int width, int height, int color) {
Expand Down Expand Up @@ -598,4 +526,12 @@ public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transiti
totalCompanies = objects.size();
invalidate();
}

public Bitmap getPlaceholder() {
return placeholder;
}

public void setPlaceholder(Bitmap placeholder) {
this.placeholder = placeholder;
}
}

0 comments on commit eba6f65

Please sign in to comment.