Search in sources :

Example 1 with TouchImageView

use of com.applozic.mobicomkit.uiwidgets.conversation.TouchImageView in project Applozic-Android-SDK by AppLozic.

the class FullScreenImageActivity method onCreate.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mobicom_image_full_screen);
    Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().show();
    showUi();
    mediaImageViewView = (TouchImageView) findViewById(R.id.full_screen_image);
    ProgressBar progressBar = (ProgressBar) findViewById(R.id.full_screen_progress_bar);
    progressBar.setVisibility(View.VISIBLE);
    String messageJson = getIntent().getStringExtra(MobiComKitConstants.MESSAGE_JSON_INTENT);
    if (!TextUtils.isEmpty(messageJson)) {
        message = (Message) GsonUtils.getObjectFromJson(messageJson, Message.class);
    }
    if (message != null && message.getFilePaths() != null && !message.getFilePaths().isEmpty()) {
        try {
            Bitmap imageBitmap = ImageUtils.decodeSampledBitmapFromPath(message.getFilePaths().get(0));
            mediaImageViewView.setImageBitmap(imageBitmap);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {

            @Override
            public void onSystemUiVisibilityChange(int visibility) {
                if (visibility == 0) {
                    getSupportActionBar().show();
                }
            }
        });
    }
    progressBar.setVisibility(View.GONE);
    connectivityReceiver = new ConnectivityReceiver();
    registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
}
Also used : IntentFilter(android.content.IntentFilter) Bitmap(android.graphics.Bitmap) ColorDrawable(android.graphics.drawable.ColorDrawable) ConnectivityReceiver(com.applozic.mobicomkit.broadcast.ConnectivityReceiver) ProgressBar(android.widget.ProgressBar) TouchImageView(com.applozic.mobicomkit.uiwidgets.conversation.TouchImageView) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

IntentFilter (android.content.IntentFilter)1 Bitmap (android.graphics.Bitmap)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Toolbar (android.support.v7.widget.Toolbar)1 View (android.view.View)1 ProgressBar (android.widget.ProgressBar)1 ConnectivityReceiver (com.applozic.mobicomkit.broadcast.ConnectivityReceiver)1 TouchImageView (com.applozic.mobicomkit.uiwidgets.conversation.TouchImageView)1