Search in sources :

Example 6 with SMS

use of dev.sagar.smsblocker.tech.beans.SMS in project SMSBlocker by sagarpawardev.

the class SilentSMSSenderActivity method process.

private void process() {
    final String methodName = "process()";
    log.justEntered(methodName);
    SMS sms = gSMSUtil.sendSMS(gAddress, gMessage);
    Toast.makeText(this, "SMS Sent", Toast.LENGTH_SHORT).show();
    log.returning(methodName);
}
Also used : SMS(dev.sagar.smsblocker.tech.beans.SMS)

Example 7 with SMS

use of dev.sagar.smsblocker.tech.beans.SMS in project SMSBlocker by sagarpawardev.

the class ThreadActivity method sendMsg.

private SMS sendMsg() {
    final String methodName = "sendMsg()";
    log.justEntered(methodName);
    String msg = etMsg.getText().toString().trim();
    String phoneNo = address;
    SMS newSMS = smsUtil.sendSMS(phoneNo, msg);
    log.returning(methodName);
    return newSMS;
}
Also used : SMS(dev.sagar.smsblocker.tech.beans.SMS)

Example 8 with SMS

use of dev.sagar.smsblocker.tech.beans.SMS in project SMSBlocker by sagarpawardev.

the class RVThreadAdapter method getItemViewType.

@Override
public int getItemViewType(int position) {
    SMS sms = smses.get(position);
    boolean smsType = (sms.getType() == SMS.TYPE_RECEIVED);
    return smsType ? TYPE_SENT : TYPE_RECEIVED;
}
Also used : SMS(dev.sagar.smsblocker.tech.beans.SMS)

Example 9 with SMS

use of dev.sagar.smsblocker.tech.beans.SMS in project SMSBlocker by sagarpawardev.

the class RVThreadAdapter method startSelections.

public boolean startSelections() {
    final String methodName = "startSelections()";
    log.justEntered(methodName);
    log.error(methodName, "This can be improved");
    log.info(methodName, "Selected SMS count: " + selectedSMSes.size());
    for (SMS sms : selectedSMSes) {
        log.debug(methodName, "Starring SMS id: " + sms.getId());
        // Starred SMS to database
        inboxUtil.starSMS(sms);
        sms.setSaved(true);
        // Starred SMS to UI
        int position = selectedSMSes.indexOf(sms);
        notifyItemChanged(position);
    }
    selectedSMSes.clear();
    log.returning(methodName);
    return true;
}
Also used : SMS(dev.sagar.smsblocker.tech.beans.SMS)

Example 10 with SMS

use of dev.sagar.smsblocker.tech.beans.SMS in project SMSBlocker by sagarpawardev.

the class RVThreadAdapter method unstarSelections.

public boolean unstarSelections() {
    final String methodName = "unstarSelections()";
    log.justEntered(methodName);
    List<SMS> unstarredSelections = new ArrayList<>();
    for (int position : markedForUnstar) {
        SMS sms = smses.get(position);
        unstarredSelections.add(sms);
    }
    log.info(methodName, "Unstarring SMSes");
    int count = inboxUtil.unstarSMSes(unstarredSelections);
    log.info(methodName, "Requested count: " + unstarredSelections.size() + " Deleted count: " + count);
    markedForUnstar.clear();
    if (count > 0)
        Toast.makeText(context, "SMS Unsaved", Toast.LENGTH_SHORT).show();
    log.returning(methodName);
    return true;
}
Also used : SMS(dev.sagar.smsblocker.tech.beans.SMS) ArrayList(java.util.ArrayList)

Aggregations

SMS (dev.sagar.smsblocker.tech.beans.SMS)27 Bundle (android.os.Bundle)11 ContentResolver (android.content.ContentResolver)5 Uri (android.net.Uri)5 ArrayList (java.util.ArrayList)5 Cursor (android.database.Cursor)4 ContentValues (android.content.ContentValues)3 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)3 DBHelper (dev.sagar.smsblocker.tech.service.helper.DBHelper)3 HashSet (java.util.HashSet)2 Animator (android.animation.Animator)1 ArgbEvaluator (android.animation.ArgbEvaluator)1 ValueAnimator (android.animation.ValueAnimator)1 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 SQLiteOpenHelper (android.database.sqlite.SQLiteOpenHelper)1 Typeface (android.graphics.Typeface)1 Handler (android.os.Handler)1 SmsManager (android.telephony.SmsManager)1 SmsMessage (android.telephony.SmsMessage)1