Sha256: 97e522783b6091fcc3995d211a689742e3b08797137f1fb4294262771700602c

Contents?: true

Size: 1.46 KB

Versions: 10

Compression:

Stored size: 1.46 KB

Contents

package com.rho.barcode;

import com.rhomobile.rhodes.RhodesActivity;
import com.rhomobile.rhodes.extmanager.AbstractRhoExtension;
import com.rhomobile.rhodes.extmanager.IRhoConfig;
import com.rhomobile.rhodes.extmanager.IRhoExtManager;
import com.rhomobile.rhodes.extmanager.IRhoWebView;
import com.rhomobile.rhodes.webview.GoogleWebView;
import com.rhomobile.rhodes.webview.WebViewConfig;

public class BarcodeRhoExtension extends AbstractRhoExtension{
	
	@Override
	public boolean onNavigateStarted(IRhoExtManager extManager, String url,
			IRhoWebView ext, boolean res) {
		// TODO Auto-generated method stub
		int disable_scanner_val = 0;
		IRhoConfig rhoelementsGetConfig= null;
        IRhoWebView vi=RhodesActivity.safeGetInstance().getMainView().getWebView(0);
        
        GoogleWebView web=null;

        try {
        	web=(GoogleWebView)vi;
        } catch ( ClassCastException e ) {
        	web=null;
        }

        if ( web != null ) {
	        rhoelementsGetConfig=web.getConfig();
	        if(rhoelementsGetConfig.getString(WebViewConfig.DISABLE_SCANNER_ON_NAVIGATION) != null){
	        	disable_scanner_val = Integer.parseInt(rhoelementsGetConfig.getString(WebViewConfig.DISABLE_SCANNER_ON_NAVIGATION));
	        }
	    }

		if(disable_scanner_val == 1){
			BarcodeFactory factory=(BarcodeFactory) BarcodeFactorySingleton.getInstance();
			if(factory!=null)
				factory.disableScannerOnNavigate();
		}
		return super.onNavigateStarted(extManager, url, ext, res);
	}


	
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rhodes-6.2.0 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-6.0.11 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.18 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.17 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.15 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.0.22 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.2 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.0.7 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.0.3 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java
rhodes-5.5.0 lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java