Search in sources :

Example 1 with LocalSMSReceivedReceiver

use of dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSReceivedReceiver in project SMSBlocker by sagarpawardev.

the class ThreadActivity method init.

private void init() {
    final String methodName = "init()";
    log.justEntered(methodName);
    try {
        // TODO Analytics App
        sAnalytics = GoogleAnalytics.getInstance(this);
        sTracker = getDefaultTracker();
        sTracker.setScreenName("Image~HomeActivity");
        sTracker.send(new HitBuilders.ScreenViewBuilder().build());
    } catch (Exception e) {
        log.info(methodName, "Logging Error..");
        log.error(methodName, e);
    }
    recyclerView = (RecyclerView) findViewById(R.id.lv_sms);
    btnSend = (ImageButton) findViewById(R.id.btn_send);
    etMsg = (EditText) findViewById(R.id.et_msg);
    holderBodyET = findViewById(R.id.holder_sms_et);
    tvReplyNotSupported = findViewById(R.id.tv_reply_not_supported);
    holderLoader = findViewById(R.id.holder_loader);
    holderMain = findViewById(R.id.holder_main);
    if (inboxUtil == null)
        inboxUtil = new InboxUtil(this, this);
    smsUtil = new SMSUtil(this);
    smsReceivedReceiver = new LocalSMSReceivedReceiver(this);
    smsDeliveredReceiver = new LocalSMSDeliveredReceiver(this);
    smsSentReceiver = new LocalSMSSentReceiver(this);
    // From Previous Activity
    Bundle basket = getIntent().getExtras();
    address = basket.getString(KEY_ADDRESS);
    adapter = new RVThreadAdapter(this, this, smses);
    amCallback = new AMCallbackThread(this, adapter);
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    mLayoutManager.setReverseLayout(true);
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setAdapter(adapter);
    log.returning(methodName);
}
Also used : LocalSMSReceivedReceiver(dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSReceivedReceiver) Bundle(android.os.Bundle) InboxUtil(dev.sagar.smsblocker.tech.utils.InboxUtil) RVThreadAdapter(dev.sagar.smsblocker.ux.adapters.RVThreadAdapter) AMCallbackThread(dev.sagar.smsblocker.ux.listeners.actionmodecallbacks.AMCallbackThread) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ReadContactPermissionException(dev.sagar.smsblocker.tech.exceptions.ReadContactPermissionException) LocalSMSDeliveredReceiver(dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSDeliveredReceiver) LocalSMSSentReceiver(dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSSentReceiver) SMSUtil(dev.sagar.smsblocker.tech.utils.SMSUtil)

Example 2 with LocalSMSReceivedReceiver

use of dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSReceivedReceiver in project SMSBlocker by sagarpawardev.

the class HomeActivity method init.

private void init() {
    fab = (FloatingActionButton) findViewById(R.id.fab);
    notificationView = (NotificationView) findViewById(R.id.notificationView);
    recyclerView = (RecyclerView) findViewById(R.id.lv_threads);
    viewPlaceHolder = findViewById(R.id.holder_placeholder);
    switchUnread = (SwitchCompat) findViewById(R.id.switch_unread);
    tvTotalCount = (TextView) findViewById(R.id.tv_total_count);
    holderLoader = findViewById(R.id.holder_loader);
    holderMain = findViewById(R.id.holder_main);
    holderSwitch = findViewById(R.id.holder_switch);
    // if(inboxUtil == null) inboxUtil = new InboxUtil(this);
    if (conversationUtil == null)
        conversationUtil = new ConversationUtil(this, this);
    adapter = new RVHomeAdapter(this, conversationMap, this);
    amCallback = new AMCallbackHome(adapter);
    smsReceiver = new LocalSMSReceivedReceiver(this);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setAdapter(adapter);
    setFont();
}
Also used : LocalSMSReceivedReceiver(dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSReceivedReceiver) RVHomeAdapter(dev.sagar.smsblocker.ux.adapters.RVHomeAdapter) ConversationUtil(dev.sagar.smsblocker.tech.utils.ConversationUtil) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) AMCallbackHome(dev.sagar.smsblocker.ux.listeners.actionmodecallbacks.AMCallbackHome)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 LocalSMSReceivedReceiver (dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSReceivedReceiver)2 Bundle (android.os.Bundle)1 RecyclerView (android.support.v7.widget.RecyclerView)1 LocalSMSDeliveredReceiver (dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSDeliveredReceiver)1 LocalSMSSentReceiver (dev.sagar.smsblocker.tech.broadcastreceivers.LocalSMSSentReceiver)1 ReadContactPermissionException (dev.sagar.smsblocker.tech.exceptions.ReadContactPermissionException)1 ConversationUtil (dev.sagar.smsblocker.tech.utils.ConversationUtil)1 InboxUtil (dev.sagar.smsblocker.tech.utils.InboxUtil)1 SMSUtil (dev.sagar.smsblocker.tech.utils.SMSUtil)1 RVHomeAdapter (dev.sagar.smsblocker.ux.adapters.RVHomeAdapter)1 RVThreadAdapter (dev.sagar.smsblocker.ux.adapters.RVThreadAdapter)1 AMCallbackHome (dev.sagar.smsblocker.ux.listeners.actionmodecallbacks.AMCallbackHome)1 AMCallbackThread (dev.sagar.smsblocker.ux.listeners.actionmodecallbacks.AMCallbackThread)1