Fix color & remove some elements
This commit is contained in:
parent
afafb3ccb4
commit
8dc9579462
|
@ -66,10 +66,6 @@ public class BaseActivity extends AppCompatActivity {
|
|||
|
||||
}
|
||||
|
||||
public void makeFullScreen() {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
|
|
|
@ -20,7 +20,6 @@ import android.net.Uri;
|
|||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.res.ResourcesCompat;
|
||||
import android.view.Window;
|
||||
|
||||
|
||||
|
@ -52,15 +51,12 @@ import android.support.transition.TransitionManager;
|
|||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.animation.AnticipateOvershootInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -128,8 +124,6 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
|
||||
|
||||
|
||||
|
||||
// makeFullScreen();
|
||||
setContentView(R.layout.activity_photoeditor);
|
||||
|
||||
initViews();
|
||||
|
@ -214,27 +208,22 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
|
||||
@Override
|
||||
public void onAddViewListener(ViewType viewType, int numberOfAddedViews) {
|
||||
Log.d(Helper.TAG, "onAddViewListener() called with: viewType = [" + viewType + "], numberOfAddedViews = [" + numberOfAddedViews + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoveViewListener(int numberOfAddedViews) {
|
||||
Log.d(Helper.TAG, "onRemoveViewListener() called with: numberOfAddedViews = [" + numberOfAddedViews + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoveViewListener(ViewType viewType, int numberOfAddedViews) {
|
||||
Log.d(Helper.TAG, "onRemoveViewListener() called with: viewType = [" + viewType + "], numberOfAddedViews = [" + numberOfAddedViews + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartViewChangeListener(ViewType viewType) {
|
||||
Log.d(Helper.TAG, "onStartViewChangeListener() called with: viewType = [" + viewType + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopViewChangeListener(ViewType viewType) {
|
||||
Log.d(Helper.TAG, "onStopViewChangeListener() called with: viewType = [" + viewType + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -266,7 +255,7 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
Intent intent = new Intent();
|
||||
intent.setType("image/*");
|
||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_REQUEST);
|
||||
startActivityForResult(Intent.createChooser(intent, getString(R.string.toot_select_image)), PICK_REQUEST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +263,7 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
@SuppressLint("MissingPermission")
|
||||
private void saveImage() {
|
||||
if (requestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
showLoading("Saving...");
|
||||
showLoading(getString(R.string.saving));
|
||||
File file = new File(Environment.getExternalStorageDirectory()
|
||||
+ File.separator + ""
|
||||
+ System.currentTimeMillis() + ".png");
|
||||
|
@ -290,14 +279,14 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
@Override
|
||||
public void onSuccess(@NonNull String imagePath) {
|
||||
hideLoading();
|
||||
showSnackbar("Image Saved Successfully");
|
||||
showSnackbar(getString(R.string.image_saved));
|
||||
mPhotoEditorView.getSource().setImageURI(Uri.fromFile(new File(imagePath)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Exception exception) {
|
||||
hideLoading();
|
||||
showSnackbar("Failed to save Image");
|
||||
showSnackbar(getString(R.string.save_image_failed));
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
|
@ -371,21 +360,21 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorL
|
|||
|
||||
private void showSaveDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setMessage("Are you want to exit without saving image ?");
|
||||
builder.setPositiveButton("Save", new DialogInterface.OnClickListener() {
|
||||
builder.setMessage( getString(R.string.confirm_exit_editing));
|
||||
builder.setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
saveImage();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
builder.setNeutralButton("Discard", new DialogInterface.OnClickListener() {
|
||||
builder.setNeutralButton(R.string.discard, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
finish();
|
||||
|
|
|
@ -11,6 +11,10 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
|
||||
public class PropertiesBSFragment extends BottomSheetDialogFragment implements SeekBar.OnSeekBarChangeListener {
|
||||
|
@ -35,7 +39,7 @@ public class PropertiesBSFragment extends BottomSheetDialogFragment implements S
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_bottom_properties_dialog, container, false);
|
||||
}
|
||||
|
||||
|
@ -52,7 +56,7 @@ public class PropertiesBSFragment extends BottomSheetDialogFragment implements S
|
|||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
|
||||
rvColor.setLayoutManager(layoutManager);
|
||||
rvColor.setHasFixedSize(true);
|
||||
ColorPickerAdapter colorPickerAdapter = new ColorPickerAdapter(getActivity());
|
||||
ColorPickerAdapter colorPickerAdapter = new ColorPickerAdapter(Objects.requireNonNull(getActivity()));
|
||||
colorPickerAdapter.setOnColorPickerClickListener(new ColorPickerAdapter.OnColorPickerClickListener() {
|
||||
@Override
|
||||
public void onColorPickerClickListener(int colorCode) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package app.fedilab.android.imageeditor.tools;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.util.Pair;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -29,10 +28,10 @@ public class EditingToolsAdapter extends RecyclerView.Adapter<EditingToolsAdapte
|
|||
mOnItemSelected = onItemSelected;
|
||||
mToolList.add(new ToolModel("Brush", R.drawable.ic_brush_edit, ToolType.BRUSH));
|
||||
mToolList.add(new ToolModel("Text", R.drawable.ic_text, ToolType.TEXT));
|
||||
mToolList.add(new ToolModel("Eraser", R.drawable.ic_eraser, ToolType.ERASER));
|
||||
// mToolList.add(new ToolModel("Eraser", R.drawable.ic_eraser, ToolType.ERASER));
|
||||
mToolList.add(new ToolModel("Filter", R.drawable.ic_photo_filter, ToolType.FILTER));
|
||||
mToolList.add(new ToolModel("Emoji", R.drawable.ic_insert_emoticon, ToolType.EMOJI));
|
||||
mToolList.add(new ToolModel("Sticker", R.drawable.ic_sticker, ToolType.STICKER));
|
||||
mToolList.add(new ToolModel("Emoji", R.drawable.ic_insert_emoticon_media, ToolType.EMOJI));
|
||||
//mToolList.add(new ToolModel("Sticker", R.drawable.ic_sticker, ToolType.STICKER));
|
||||
}
|
||||
|
||||
public interface OnItemSelected {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<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="#606984"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,17.5c2.33,0 4.31,-1.46 5.11,-3.5L6.89,14c0.8,2.04 2.78,3.5 5.11,3.5z"/>
|
||||
</vector>
|
|
@ -1,79 +1,82 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/black"
|
||||
android:orientation="vertical">
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rvColors"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:orientation="horizontal"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sbOpacity"
|
||||
tools:listitem="@layout/color_picker_item_list"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sbOpacity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:progress="100"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtOpacity" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rvColors"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:orientation="horizontal"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sbOpacity"
|
||||
tools:background="@android:color/black"
|
||||
tools:listitem="@layout/color_picker_item_list"
|
||||
android:layout_alignParentRight="true" />
|
||||
<TextView
|
||||
android:id="@+id/txtOpacity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="@string/opacity"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sbSize" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sbOpacity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:progress="100"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtOpacity" />
|
||||
<SeekBar
|
||||
android:id="@+id/sbSize"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:progress="25"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtBrushSize" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtOpacity"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="Opacity"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sbSize" />
|
||||
<TextView
|
||||
android:id="@+id/txtBrushSize"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/label_brush"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sbSize"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:progress="25"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtBrushSize" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtBrushSize"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Brush"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</LinearLayout>
|
|
@ -22,7 +22,7 @@
|
|||
android:id="@+id/txtFilterName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#90000000"
|
||||
android:background="#606984"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:textColor="@android:color/white"
|
||||
|
|
|
@ -970,6 +970,12 @@
|
|||
<string name="label_filter">Filter</string>
|
||||
<string name="label_adjust">Adjust</string>
|
||||
<string name="label_brush">Brush</string>
|
||||
<string name="confirm_exit_editing">Are you want to exit without saving image?</string>
|
||||
<string name="discard">Discard</string>
|
||||
<string name="saving">Saving...</string>
|
||||
<string name="image_saved">Image Saved Successfully!</string>
|
||||
<string name="save_image_failed">Failed to save Image</string>
|
||||
<string name="opacity">Opacity</string>
|
||||
<plurals name="number_of_vote">
|
||||
<item quantity="one">%d vote</item>
|
||||
<item quantity="other">%d votes</item>
|
||||
|
|
Loading…
Reference in New Issue