Android Open Source - android-document-viewer Navigation View Activity






From Project

Back to project page android-document-viewer.

License

The source code is released under:

?Sitewaerts Document Viewer App for Android? is free software: you can redistribute it and/or modify it under the terms of the Affero GNU General Public License (http://www.gnu.org/licenses/agpl-3...

If you think the Android project android-document-viewer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.sitewaerts.cleverdox.viewer;
//from  www  . j a  v a  2s .c om
import android.app.ActionBar;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.MenuItem;

import com.artifex.mupdfdemo.OutlineActivity;
import com.artifex.mupdfdemo.OutlineActivityData;
import com.artifex.mupdfdemo.OutlineItem;

public class NavigationViewActivity extends OutlineActivity {
  
  private String closeLabel;
  private boolean bookmarksEnabled;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
        // Get the intent that started this activity
        Intent intent = getIntent();
        // get options passed from cordova
        closeLabel = intent.getStringExtra("closeLabel");
        bookmarksEnabled = intent.getBooleanExtra("bookmarksEnabled", false); //XXX is false the desired default value?
        
      //create action bar
      ActionBar ab = getActionBar();
      //enable up navigation
      ab.setDisplayHomeAsUpEnabled(true);
//      //invisible icon
//      ab.setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
//      //set title to close label string from cordova options
//      if (closeLabel != null) {
//        ab.setTitle(closeLabel);
//      }
  }
  
    /**
     * handle action bar menu events
     */
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle item selection
      switch (item.getItemId()) {
        //up navigation
        case android.R.id.home:
          finish();
          return true;
          default:
              return super.onOptionsItemSelected(item);
      }
  }
}




Java Source Code List

de.sitewaerts.cleverdox.viewer.DocumentViewerActivity.java
de.sitewaerts.cleverdox.viewer.NavigationViewActivity.java
de.sitewaerts.cleverdox.viewer.PrintActivity.java
de.sitewaerts.cleverdox.viewer.SDVMuPDFReaderView.java
de.sitewaerts.cleverdox.viewer.SplashScreenActivity.java