Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: android
jdk: oraclejdk8
sudo: false
dist: trusty

env:
global:
- ANDROID_API_LEVEL=22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.fossasia.phimpme.editor.fragment;

import android.content.DialogInterface;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -137,7 +139,30 @@ public StickerView getmStickerView() {
public void onClick(View v) {
switch (v.getId()) {
case R.id.sticker_apply:
applyStickers();
if (!mStickerView.getBank().isEmpty()) {
applyStickers();
} else {
new AlertDialog.Builder(getContext())
.setTitle(R.string.no_stickers)
.setMessage(R.string.exit_no_stickers)
.setPositiveButton(
android.R.string.yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
backToMain();
}
})
.setNegativeButton(
android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.setIcon(R.drawable.ic_red_dialog_alert)
.show();
}
break;
case R.id.sticker_cancel:
backToMain();
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_red_dialog_alert.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@android:drawable/ic_dialog_alert"
android:tint="#FF0000"/>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,8 @@
<string name="frame">Frame</string>
<string name="write">Write</string>
<string name="share">share</string>
<string name="no_stickers">No stickers applied !</string>
<string name="exit_no_stickers">Are you sure you want to exit without adding any stickers?</string>
<string name="compress">The image has been compressed successfully.</string>

<!--ACCOUNTS-->
Expand Down