コード例 #1
0
  private void initViewer() {
    settings.setLoadsImagesAutomatically(true);
    settings.setUseWideViewPort(true);
    settings.setLoadWithOverviewMode(true);
    settings.setLightTouchEnabled(true);
    settings.setBuiltInZoomControls(true);
    settings.setJavaScriptEnabled(true);

    viewer.setInitialScale(0);
    viewer.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    viewer.setHorizontalScrollBarEnabled(false);
    viewer.setVerticalScrollBarEnabled(false);
    viewer.setBackgroundColor(0x000000);
    viewer.clearCache(true);
    viewer.setFocusable(false);

    viewer.setWebViewClient(
        new WebViewClient() {
          @Override
          public void onPageFinished(WebView view, String url) {}

          @Override
          public void onReceivedError(
              WebView view, int errorCode, String description, String failingUrl) {}

          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
            return false;
          }
        });
  }
コード例 #2
0
  @SuppressLint("NewApi")
  private void init(final View rootView) {
    WebView wv;
    wv = (WebView) rootView.findViewById(R.id.webView1);
    wv.setVerticalScrollBarEnabled(false); // ��������� ���������
    wv.setHorizontalScrollBarEnabled(false); // ��������� ���������
    wv.getSettings().setJavaScriptEnabled(true); // �������� JavaScript
    wv.getSettings().setJavaScriptEnabled(true); // �������� JavaScript

    wv.getSettings().setDomStorageEnabled(true); // �������� localStorage � �.�.
    wv.getSettings()
        .setSupportZoom(
            false); // ��������� ���, �.�. ���������� ���������� �������� ������������ �� ��������
    wv.getSettings().setSupportMultipleWindows(true); // ��������� ��������� �������.
    // �.�. ������������ ������ ������ � SPA ����������

    // Other webview options
    wv.getSettings().setLoadWithOverviewMode(true);
    wv.getSettings().setCacheMode(android.webkit.WebSettings.LOAD_NO_CACHE);
    wv.getSettings().setAllowFileAccess(true);
    wv.getSettings().setLoadsImagesAutomatically(true);
    webMessageAPI = new WebMessageAPI(userId, wv, rootView);

    wv.addJavascriptInterface(webMessageAPI, "WMAPI"); // ����������� ������ � JavaScript.
    // ��� ����� ��� ���� � ��� Java. � JavaScript`� ��������� ������ API
    wv.loadUrl("file:///android_asset/pages/messages.html");
    // ��������� ���� ���������
    wv.setWebChromeClient(new WebChromeClient());
  }
コード例 #3
0
  private void setupViews() {

    mWebView = (WebView) findViewById(R.id.WebView01);
    mWebView.setVerticalScrollBarEnabled(false);
    mWebView.setHorizontalScrollBarEnabled(false);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.setWebViewClient(new SuperWebViewClient());
    new WebViewTask().execute(base);
  }
コード例 #4
0
ファイル: Newswebview.java プロジェクト: andrewnelson23/OBU_a
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.news);
   webView = (WebView) findViewById(R.id.News);
   webView.loadUrl("http://www.okbu.edu/m/news.html");
   webView.setVerticalScrollBarEnabled(true);
   webView.setHorizontalScrollBarEnabled(true);
   webView.setWebViewClient(new WebViewClient());
   webView.getSettings().setJavaScriptEnabled(true);
 }
コード例 #5
0
ファイル: Entry3.java プロジェクト: lancexin/infogiga
 /**
  * 初始化webview,进行必须的设置
  *
  * @param view
  */
 private void initWebView(WebView view) {
   view.setVerticalScrollBarEnabled(false);
   view.setHorizontalScrollBarEnabled(false);
   view.addJavascriptInterface(new JSInterface(), "base");
   view.addJavascriptInterface(new JSContactInterface(contact), "contact");
   view.addJavascriptInterface(new JSMessageInterface(message), "message");
   view.addJavascriptInterface(new JSApplicationInterface(appManager), "application");
   view.addJavascriptInterface(new JSMotionInterface(), "motion");
   view.setFocusable(false);
 }
コード例 #6
0
 private void setUpWebView() {
   mWebView = new WebView(getContext());
   mWebView.setVerticalScrollBarEnabled(false);
   mWebView.setHorizontalScrollBarEnabled(false);
   mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
   mWebView.getSettings().setJavaScriptEnabled(true);
   mWebView.loadUrl(mUrl);
   mWebView.setLayoutParams(FILL);
   mContent.addView(mWebView);
 }
コード例 #7
0
ファイル: TwitterDialog.java プロジェクト: dzlab/LaPoste
  private void setUpWebView(LinearLayout layout) {
    webView = new WebView(getContext());

    webView.setVerticalScrollBarEnabled(false);
    webView.setHorizontalScrollBarEnabled(false);
    webView.setWebViewClient(new TwitterWebViewClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.loadUrl(url);
    webView.setLayoutParams(FILL);

    layout.addView(webView);
  }
コード例 #8
0
 private void setUpWebView() {
   webView = new WebView(getContext());
   webView.setVerticalScrollBarEnabled(false);
   webView.setHorizontalScrollBarEnabled(false);
   webView.getSettings().setJavaScriptEnabled(true);
   webView.setWebViewClient(new RenrenDialog.RenrenWebViewClient());
   webView.loadUrl(mUrl);
   FrameLayout.LayoutParams fill =
       new FrameLayout.LayoutParams(
           ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
   webView.setLayoutParams(fill);
   content.addView(webView);
 }
コード例 #9
0
  private void initWebView() {
    WebSettings settings = webView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setPluginsEnabled(true);
    settings.setAllowFileAccess(false);
    settings.setPluginState(WebSettings.PluginState.ON);

    webView.setBackgroundColor(0x00000000); // transparent
    webView.setVerticalScrollBarEnabled(false);
    webView.setHorizontalScrollBarEnabled(false);
    webView.setWebChromeClient(new OpenXAdWebChromeClient());

    addView(webView);
  }
コード例 #10
0
ファイル: TwitterDialog.java プロジェクト: vsvictor/ShhutApp
  @SuppressLint("SetJavaScriptEnabled")
  private void setUpWebView(int margin) {
    LinearLayout webViewContainer = new LinearLayout(getContext());
    browser = new WebView(getContext());
    browser.setVerticalScrollBarEnabled(false);
    browser.setHorizontalScrollBarEnabled(false);
    browser.setWebViewClient(new TwitterDialog.TwWebViewClient());
    browser.getSettings().setJavaScriptEnabled(true);
    browser.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT");
    browser.setLayoutParams(FILL);

    webViewContainer.setPadding(margin, margin, margin, margin);
    webViewContainer.addView(browser);
    content.addView(webViewContainer);
  }
コード例 #11
0
ファイル: FbDialog.java プロジェクト: carlrice/maven
  private void setUpWebView(int margin) {
    LinearLayout webViewContainer = new LinearLayout(getContext());
    mWebView = new WebView(getContext());
    mWebView.setVerticalScrollBarEnabled(false);
    mWebView.setHorizontalScrollBarEnabled(false);
    mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.loadUrl(mUrl);
    mWebView.setLayoutParams(FILL);
    mWebView.setVisibility(View.INVISIBLE);

    webViewContainer.setPadding(margin, margin, margin, margin);
    webViewContainer.addView(mWebView);
    mContent.addView(webViewContainer);
  }
コード例 #12
0
  private void loadWebViewUrl(String url) throws Exception {
    WebSettings settings = webviewAddScoin.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setUseWideViewPort(true);

    webviewAddScoin.setHorizontalScrollBarEnabled(false);
    webviewAddScoin.setVerticalScrollBarEnabled(true);
    webviewAddScoin.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    webviewAddScoin.setWebViewClient(new PaymentWebClient());

    closeKeyBoard();
    progressBar.setVisibility(VISIBLE);
    showWebView(true);

    webviewAddScoin.loadUrl(url);
  }
コード例 #13
0
 @SuppressLint({"SetJavaScriptEnabled"})
 private void setUpWebView(int paramInt)
 {
   LinearLayout localLinearLayout = new LinearLayout(getContext());
   webView = new WebDialog.3(this, getContext());
   webView.setVerticalScrollBarEnabled(false);
   webView.setHorizontalScrollBarEnabled(false);
   webView.setWebViewClient(new WebDialog.DialogWebViewClient(this, null));
   webView.getSettings().setJavaScriptEnabled(true);
   webView.loadUrl(url);
   webView.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
   webView.setVisibility(4);
   webView.getSettings().setSavePassword(false);
   webView.getSettings().setSaveFormData(false);
   localLinearLayout.setPadding(paramInt, paramInt, paramInt, paramInt);
   localLinearLayout.addView(webView);
   localLinearLayout.setBackgroundColor(-872415232);
   contentFrameLayout.addView(localLinearLayout);
 }
コード例 #14
0
    // onPostExecute displays the results of the AsyncTask.
    @Override
    protected void onPostExecute(String xmlData) {
      String result;
      //			try {
      //				//result = parseData(xmlData);
      //			} catch (XmlPullParserException e) {
      //				// TODO Auto-generated catch block
      //				result = e.getMessage();
      //			} catch (IOException e) {
      //				// TODO Auto-generated catch block
      //				result = e.getMessage();
      //			}
      //            textView.setText(xmlData);

      setContentView(R.layout.activity_get_river_levels); // setContentView(myWebView);
      WebView myWebView = (WebView) findViewById(R.id.webview); // new WebView(this);
      myWebView.setVerticalScrollBarEnabled(true);
      myWebView.loadData(xmlData, "text/html", null);
    }
コード例 #15
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.webview);
   dialogListener = this;
   weibo = Weibo.getInstance();
   weibo.setupConsumerConfig(CONSUMER_KEY, CONSUMER_SECRET);
   weibo.setRedirectUrl(MREDIRECTURL);
   Utility.setAuthorization(new Oauth2AccessTokenHeader());
   webView = (WebView) this.findViewById(R.id.wv_id);
   webView.setHorizontalScrollBarEnabled(false);
   webView.setVerticalScrollBarEnabled(false);
   webView.getSettings().setJavaScriptEnabled(true);
   webView.setWebViewClient(new MyWebViewClient());
   webView.loadUrl(getOauthUrl());
   pd = new ProgressDialog(this);
   pd.requestWindowFeature(Window.FEATURE_NO_TITLE);
   pd.setMessage("正在载入...");
 }
コード例 #16
0
ファイル: WebViewFactory.java プロジェクト: jeozey/Wisp
  public static void initWebView(Context context, WebView mWebView) {
    if (mWebView != null) {
      mWebView.setDrawingCacheBackgroundColor(0x00000000);
      mWebView.setFocusableInTouchMode(true);
      mWebView.setFocusable(true);
      mWebView.setAnimationCacheEnabled(false);
      mWebView.setDrawingCacheEnabled(true);
      mWebView.setBackgroundColor(context.getResources().getColor(android.R.color.white));
      mWebView.getRootView().setBackgroundDrawable(null);
      mWebView.setWillNotCacheDrawing(false);
      mWebView.setAlwaysDrawnWithCacheEnabled(true);
      mWebView.setScrollbarFadingEnabled(true);
      mWebView.setHorizontalScrollBarEnabled(false);
      mWebView.setVerticalScrollBarEnabled(true);
      mWebView.setSaveEnabled(true);
      mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

      initializeSettings(mWebView.getSettings(), context);
    }
  }
コード例 #17
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_web_view);

    android.webkit.WebView mywebView = (android.webkit.WebView) findViewById(R.id.myweb);

    // Allow Web View override Chrome to load pages
    mywebView.setWebViewClient(
        new WebViewClient() {
          public boolean shouldOverrideUrlLoading(android.webkit.WebView view, String url) {
            view.loadUrl(url);
            return true;
          }
        });
    WebSettings webSettings = mywebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    mywebView.loadUrl("https://www.lib.ncsu.edu/reservearoom");
    mywebView.getSettings().setSupportMultipleWindows(true);
    mywebView.setHorizontalScrollBarEnabled(true);
    mywebView.setVerticalScrollBarEnabled(true);

    // setContentView(mywebView);
  }
コード例 #18
0
  @SuppressWarnings("deprecation")
  @SuppressLint("SetJavaScriptEnabled")
  @Override
  /** When the dialog is created, we add the webview and load the authorize url. */
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    mProgress = new ProgressDialog(getContext());
    mProgress.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mProgress.setMessage("Loading...");

    mLayout = new LinearLayout(getContext());
    mLayout.setOrientation(LinearLayout.VERTICAL);

    mWebView = new WebView(getContext());
    mWebView.setVerticalScrollBarEnabled(false);
    mWebView.setHorizontalScrollBarEnabled(false);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setSupportZoom(false);
    mWebView.setLayoutParams(MATCH);

    mWebView.setWebViewClient(new OAuthWebViewClient());
    mWebView.setWebChromeClient(new WebChromeClient());

    mWebView.loadUrl(mUrl);
    mLayout.addView(mWebView);

    Display display = getWindow().getWindowManager().getDefaultDisplay();
    addContentView(
        mLayout, new FrameLayout.LayoutParams(display.getWidth() - 20, display.getHeight() - 20));
    CookieSyncManager.createInstance(getContext());
    CookieManager cookieManager = CookieManager.getInstance();
    cookieManager.removeAllCookie();
  }
コード例 #19
0
  private void initComponent(Intent intent) {
    LinearLayout llHeaderBase = (LinearLayout) findViewById(R.id.llHeaderBase);
    ThemeUtil.setSecondaryImageHeader(llHeaderBase);

    if (intent == null) {
      return;
    }

    Bundle bundle = intent.getExtras();
    realPath = bundle.getString("image-path");
    imageUrl = Uri.fromFile(new File(realPath)).toString();

    String html = String.format(WEB_HTML, getMaxWidth(), imageUrl);

    webViewer = (WebView) findViewById(R.id.wvImageViewer);
    webViewer.getSettings().setSupportZoom(true);
    webViewer.getSettings().setBuiltInZoomControls(true);
    webViewer.setBackgroundColor(Color.BLACK);
    webViewer.setVerticalScrollBarEnabled(false);
    webViewer.setHorizontalScrollBarEnabled(false);
    // webViewer.setOnTouchListener(new ImageWebViewDoubleClickListener());

    webViewer.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");
  }
コード例 #20
0
ファイル: Survey.java プロジェクト: Marcos-G/punya
  /**
   * Creates a new Survey component.
   *
   * @param container container the component will be placed in
   * @throws IOException
   */
  public Survey(ComponentContainer container) throws IOException {
    super(container);
    mainUI = container.$form();
    exportRoot =
        new java.io.File(Environment.getExternalStorageDirectory(), mainUI.getPackageName())
            + java.io.File.separator
            + "export";

    JsonParser parse = new JsonParser();
    webview = new WebView(container.$context());
    webview.getSettings().setJavaScriptEnabled(true);
    webview.setFocusable(true);
    webview.setVerticalScrollBarEnabled(true);

    container.$add(this);

    webview.setOnTouchListener(
        new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
            switch (event.getAction()) {
              case MotionEvent.ACTION_DOWN:
              case MotionEvent.ACTION_UP:
                if (!v.hasFocus()) {
                  v.requestFocus();
                }
                break;
            }
            return false;
          }
        });

    // set the initial default properties. Height and Width
    // will be fill-parent, which will be the default for the web viewer.

    Width(LENGTH_FILL_PARENT);
    Height(LENGTH_FILL_PARENT);

    // set default survey style
    style = TEXTBOX; // default style

    // see if the Survey is created by someone tapping on a notification!
    // create the Survey and load it in the webviewer
    /* e.g.
     * value = {
     * "style": "multipleChoice",
     * "question": "What is your favorite food"
     * "options": ["apple", "banana", "strawberry", "orange"],
     * "surveyGroup": "MIT-food-survey"
     * }
     *
     */
    initValues = container.$form().getSurveyStartValues();
    Log.i(TAG, "startVal Suvey:" + initValues.toString());
    if (initValues != "") {

      JsonObject values = (JsonObject) parse.parse(initValues);
      this.style = values.get("style").getAsString();
      this.question = values.get("question").getAsString();
      this.surveyGroup = values.get("surveyGroup").getAsString();
      ArrayList<String> arrOptions = new ArrayList<String>();
      JsonArray _options = values.get("options").getAsJsonArray();
      for (int i = 0; i < _options.size(); i++) {
        arrOptions.add(_options.get(i).getAsString());
      }

      this.options = arrOptions;
      this.styleFromIntent = values.get("style").getAsString();
      Log.i(TAG, "Survey component got created");
    }
  }
コード例 #21
0
  public WebFrame(Activity context, boolean allowNavigation, boolean scroll, boolean showExit) {
    super(context);
    initCompatibility();
    mActivity = context;
    mWebView = new WebView(context);
    mWebView.setVerticalScrollBarEnabled(scroll);
    mWebView.setHorizontalScrollBarEnabled(scroll);
    mWebView.setBackgroundColor(Color.TRANSPARENT);
    setLayer(mWebView);
    WebSettings webSettings = mWebView.getSettings();
    webSettings.setSavePassword(false);
    webSettings.setSaveFormData(false);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setPluginsEnabled(true);
    webSettings.setSupportZoom(enableZoom);
    webSettings.setBuiltInZoomControls(enableZoom);
    mWebViewClient = new WebViewClient(mActivity, allowNavigation);
    mWebView.setWebViewClient(mWebViewClient);

    final Activity localContext = context;
    if (showExit) {
      ImageView bg = new ImageView(context);
      bg.setBackgroundColor(Color.TRANSPARENT);
      addView(
          bg,
          new FrameLayout.LayoutParams(
              android.view.ViewGroup.LayoutParams.FILL_PARENT,
              android.view.ViewGroup.LayoutParams.FILL_PARENT,
              Gravity.CENTER));
      addView(
          mWebView,
          new FrameLayout.LayoutParams(
              android.view.ViewGroup.LayoutParams.FILL_PARENT,
              android.view.ViewGroup.LayoutParams.FILL_PARENT,
              Gravity.CENTER));
      mExitButton = new ImageView(context);
      mExitButton.setAdjustViewBounds(false);
      mExitButton.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              localContext.finish();
            }
          });
      int buttonSize =
          (int)
              TypedValue.applyDimension(
                  TypedValue.COMPLEX_UNIT_DIP, 35, getResources().getDisplayMetrics());
      mExitButton.setImageDrawable(
          ResourceManager.getStaticResource(
              context, ResourceManager.DEFAULT_SKIP_IMAGE_RESOURCE_ID));
      FrameLayout.LayoutParams params =
          new FrameLayout.LayoutParams(buttonSize, buttonSize, Gravity.TOP | Gravity.RIGHT);
      int margin =
          (int)
              TypedValue.applyDimension(
                  TypedValue.COMPLEX_UNIT_DIP, 6, getResources().getDisplayMetrics());
      params.topMargin = margin;
      params.rightMargin = margin;
      addView(mExitButton, params);
    } else {
      addView(
          mWebView,
          new FrameLayout.LayoutParams(
              android.view.ViewGroup.LayoutParams.FILL_PARENT,
              android.view.ViewGroup.LayoutParams.FILL_PARENT,
              Gravity.CENTER));
    }
  }
コード例 #22
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LOG.Log(Module.GUI, "onCreate");

    // GUI initialization code
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

    disableThumbnails = checkUnityProperty("Unity_DisableThumbnails");

    // security reasons; don't allow screen shots while this window is displayed
    /* not valid for builds under level 14 */
    if (disableThumbnails && Build.VERSION.SDK_INT >= 14) {
      getWindow()
          .setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
    }

    appView = new WebView(this);
    appView.enablePlatformNotifications();
    setGlobalProxy();

    appView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    appView.setId(APPVIEW_ID);
    appView.setWebViewClient(new UnityWebViewClient());
    appView.getSettings().setJavaScriptEnabled(true);
    appView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    appView.getSettings().setAllowFileAccess(true);
    appView.getSettings().setSupportZoom(false);
    appView.getSettings().setAppCacheEnabled(false);
    appView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    appView.getSettings().setAppCacheMaxSize(0);
    appView.getSettings().setSavePassword(false);
    appView.getSettings().setSaveFormData(false);
    appView.getSettings().setDefaultTextEncodingName("UTF-8");
    appView.getSettings().setGeolocationEnabled(true);
    appView.getSettings().setLightTouchEnabled(true);
    appView.getSettings().setRenderPriority(RenderPriority.HIGH);
    appView.getSettings().setDomStorageEnabled(true); // [MOBPLAT-129] enable HTML5 local storage

    appView.setVerticalScrollBarEnabled(false);

    // Required settings to enable HTML5 database storage
    appView.getSettings().setDatabaseEnabled(true);
    String databasePath =
        this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
    appView.getSettings().setDatabasePath(databasePath);

    webChromeClient =
        new WebChromeClient() {

          // Required settings to enable HTML5 database storage
          @Override
          public void onExceededDatabaseQuota(
              String url,
              String databaseIdentifier,
              long currentQuota,
              long estimatedSize,
              long totalUsedQuota,
              WebStorage.QuotaUpdater quotaUpdater) {
            quotaUpdater.updateQuota(estimatedSize * 2);
          };

          @Override
          public void onReachedMaxAppCacheSize(
              long spaceNeeded,
              long totalUsedQuota,
              android.webkit.WebStorage.QuotaUpdater quotaUpdater) {
            quotaUpdater.updateQuota(0);
          };

          @Override
          public boolean onConsoleMessage(ConsoleMessage cm) {
            LOG.Log(
                Module.GUI,
                cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId());
            return true;
          }
        };

    appView.setWebChromeClient(webChromeClient);

    // create the application logger
    LogManager.setDelegate(new AndroidLoggerDelegate());

    // save the context for further access
    AndroidServiceLocator.setContext(this);

    // initialize the service locator
    activityManager = new AndroidActivityManager(this, appView);

    // killing previous background processes from the same package
    activityManager.killBackgroundProcesses();

    AndroidServiceLocator serviceLocator =
        (AndroidServiceLocator) AndroidServiceLocator.GetInstance();
    serviceLocator.RegisterService(
        this.getAssets(), AndroidServiceLocator.SERVICE_ANDROID_ASSET_MANAGER);
    serviceLocator.RegisterService(
        activityManager, AndroidServiceLocator.SERVICE_ANDROID_ACTIVITY_MANAGER);
    startServer();

    /* THIS COULD NOT BE CHECKED ON API LEVEL < 11; NO suchmethodexception
    boolean hwAccelerated = appView.isHardwareAccelerated();
    if(hwAccelerated)
    	LOG.Log(Module.GUI,"Application View is HARDWARE ACCELERATED");
    else
    	LOG.Log(Module.GUI,"Application View is NOT hardware accelerated");
    */

    final IntentFilter actionFilter = new IntentFilter();
    actionFilter.addAction(android.net.ConnectivityManager.CONNECTIVITY_ACTION);
    // actionFilter.addAction("android.intent.action.SERVICE_STATE");
    registerReceiver(new AndroidNetworkReceiver(appView), actionFilter);

    final Activity currentContext = this;
    new Thread(
            new Runnable() {
              public void run() {
                currentContext.runOnUiThread(
                    new Runnable() {
                      public void run() {
                        appView.loadUrl(WEBVIEW_MAIN_URL);
                      }
                    });
              }
            })
        .start();

    holdSplashScreenOnStartup = checkUnityProperty("Unity_HoldSplashScreenOnStartup");
    hasSplash = activityManager.showSplashScreen(appView);
    RemoteNotificationIntentService.loadNotificationOptions(getResources(), appView, this);
    LocalNotificationReceiver.initialize(appView, this);
  }
コード例 #23
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "onCreate()");
    super.onCreate(savedInstanceState);

    getWindow().requestFeature(Window.FEATURE_NO_TITLE);

    if (fullescreen) {
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }

    // This builds the view. We could probably get away with NOT having a
    // LinearLayout, but I like having a bucket!
    // Display display = getWindowManager().getDefaultDisplay();
    // int width = display.getWidth();
    // int height = display.getHeight();

    LinearLayout.LayoutParams containerParams =
        new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0F);

    LinearLayout.LayoutParams webviewParams =
        new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 1.0F);

    root = new LinearLayout(this);
    root.setOrientation(LinearLayout.VERTICAL);
    root.setBackgroundColor(Color.BLACK);
    root.setLayoutParams(containerParams);

    appView = new WebView(this);
    appView.setLayoutParams(webviewParams);

    WebViewReflect.checkCompatibility();

    /*
     * This changes the setWebChromeClient to log alerts to LogCat!
     * Important for Javascript Debugging
     */
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ECLAIR) {
      appView.setWebChromeClient(new AppWebChromeClient());
    }
    appView.setWebViewClient(new AppWebViewClient());

    appView.setInitialScale(100);
    appView.setVerticalScrollBarEnabled(false);

    WebSettings settings = appView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);

    Package pack = this.getClass().getPackage();
    String appPackage = pack.getName();

    WebViewReflect.setStorage(settings, true, "/data/data/" + appPackage + "/app_database/");

    /* Bind the appView object to the gap class methods */
    buildWebView(appView);

    root.addView(appView);
    setContentView(root);

    // If url was passed in to intent, then init webview, which will load
    // the url
    Bundle bundle = this.getIntent().getExtras();
    if (bundle != null) {
      String path = bundle.getString("path");
      if (path != null) {
        this.initPath = path;
      }
      String surl = bundle.getString("serverUrl");
      if (surl != null && surl.length() > 0) {
        bindServerUrl(surl);
      }
    }
    // Setup the hardware volume controls to handle volume control
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
  }
コード例 #24
0
  /** 初始化主页面视图 * */
  private void initContentWebView() {
    contentWebView = (WebView) this.findViewById(R.id.webView1);

    contentWebView.setWebChromeClient(new WebChromeClientEx(PortalActivity.this));
    contentWebView.setWebViewClient(new WebViewClientEx(this));
    contentWebView.setInitialScale(0);
    contentWebView.setScrollBarStyle(0); // 滚动条风格,为0就是不给滚动条留空间,滚动条覆盖在网页上
    contentWebView.setVerticalScrollBarEnabled(false);
    contentWebView.requestFocusFromTouch();

    // Enable JavaScript
    WebSettings settings = contentWebView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);

    // Set the nav dump for HTC
    settings.setNavDump(true);

    // 支持html5的localStorage
    settings.setDatabaseEnabled(true);
    String databasePath =
        this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
    settings.setDatabasePath(databasePath);
    settings.setDomStorageEnabled(true);

    // Enable built-in geolocation
    settings.setGeolocationEnabled(true);

    // Clear cancel flag
    this.cancelLoadUrl = false;

    String version = android.os.Build.VERSION.RELEASE;
    if (version != null && version.indexOf("4.0") != -1) {
      this.clearCache();
    }
    contentWebView.addJavascriptInterface(
        new Object() {
          @SuppressWarnings("unused")
          public void eventHandle(String params) {
            appEventHandle(new AppEvent(params));
          }

          @SuppressWarnings("unused")
          public String getAndroidVersion() {
            return android.os.Build.VERSION.RELEASE;
          }

          @SuppressWarnings("unused")
          public void openAppSetting() {
            openSettingDlg();
          }

          @SuppressWarnings("unused")
          public void checkPage(String success) {
            if ("true".equalsIgnoreCase(success)) {
              loadSuccess = true;
              spinnerStop();
            } else {
              PortalActivity me = PortalActivity.this;
              me.runOnUiThread(
                  new Runnable() {
                    public void run() {
                      showErrorTip("连接超时,似乎加载的页面不正常!请检查网络和配置");
                      openSettingDlg();
                    }
                  });
            }
          }
        },
        "nativeApp");
    contentWebView.addJavascriptInterface(
        new Object() {
          @SuppressWarnings("unused")
          public void testCall() {
            injectJSObject();
          }
        },
        "justepApp");

    contentWebView.setDownloadListener(new JustepAppWebViewDownLoadListener());

    /**
     * contentWebView.setWebViewClient(new WebViewClient() {
     *
     * <p>});
     */
  }
コード例 #25
0
ファイル: DroidGap.java プロジェクト: j0ton/phonegap-android
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    // This builds the view.  We could probably get away with NOT having a LinearLayout, but I like
    // having a bucket!

    LinearLayout.LayoutParams containerParams =
        new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0F);

    LinearLayout.LayoutParams webviewParams =
        new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 1.0F);

    root = new LinearLayout(this);
    root.setOrientation(LinearLayout.VERTICAL);
    root.setBackgroundColor(Color.BLACK);
    root.setLayoutParams(containerParams);

    appView = new WebView(this);
    appView.setLayoutParams(webviewParams);

    WebViewReflect.checkCompatibility();

    if (android.os.Build.VERSION.RELEASE.startsWith("2."))
      appView.setWebChromeClient(new EclairClient(this));
    else {
      appView.setWebChromeClient(new GapClient(this));
    }

    appView.setInitialScale(100);
    appView.setVerticalScrollBarEnabled(false);

    WebSettings settings = appView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);

    Package pack = this.getClass().getPackage();
    String appPackage = pack.getName();

    WebViewReflect.setStorage(settings, true, "/data/data/" + appPackage + "/app_database/");

    // Disable cookies
    CookieManager cookieManager = CookieManager.getInstance();
    cookieManager.setAcceptCookie(false);

    // Turn on DOM storage!
    WebViewReflect.setDomStorage(settings);
    // Turn off native geolocation object in browser - we use our own :)
    WebViewReflect.setGeolocationEnabled(settings, true);
    /* Bind the appView object to the gap class methods */
    bindBrowser(appView);
    if (cupcakeStorage != null) cupcakeStorage.setStorage(appPackage);

    root.addView(appView);

    setContentView(root);
  }
コード例 #26
0
  /**
   * webview 显示本地图片,自适应布局大小,图片可缩放
   *
   * @param mContext
   * @param webview
   * @param imageLocalUrl
   * @param isAdapterScreenWidth 是否自适应屏幕宽度
   * @param color 0-255
   */
  public static void showLocalImage(
      Context mContext,
      final WebView webview,
      final String imageLocalUrl,
      int color,
      boolean isAdapterScreenWidth,
      boolean doubleClickEabled) {

    boolean fileExist = FileUtils.isExists(imageLocalUrl);

    if (fileExist) {
      String bgcolor = ColorUtils.toBrowserColor(color);

      ZogUtils.printLog(WebViewUtils.class, "bgcolor:" + bgcolor);

      String adapterScreenWidth = "";
      if (isAdapterScreenWidth) {
        adapterScreenWidth = " width:99.9%;";
      }

      String style =
          "<style>"
              + "* { margin:0; padding:0; background-color:"
              + bgcolor
              + ";  }"
              + "img { "
              + adapterScreenWidth
              + " margin:0; padding:0; }"
              + "div{"
              + adapterScreenWidth
              +
              //                            "     border: thin solid #F00;" +
              "    margin:0; padding:0;"
              + " }/*这里的width height 大于图片的宽高*/"
              + "table{ height:100%; width:100%; text-align:center;}"
              + " </style>";

      String body =
          "    <body>"
              + "        <div>"
              + "            <table>"
              + "                <tr>"
              + "                    <td>"
              + "                       <img src=\"file://"
              + imageLocalUrl
              + "\""
              +
              //                            "                                width=" + width +
              "                               margin="
              + 0
              + "                               padding="
              + 0
              +
              //                    "                               height="+height+
              "                           />"
              + "                    </td>"
              + "                </tr>"
              + "            </table>"
              + "        </div>"
              + "    </body>"
              + "";

      String data = style + body;

      webview.loadDataWithBaseURL("file://" + imageLocalUrl, data, "text/html", "utf-8", null);

      // webview.loadUrl(imageUrl);//直接显示网上图片

      webview.setVerticalScrollBarEnabled(false); // 取消Vertical ScrollBar显示
      webview.setHorizontalScrollBarEnabled(false); // 取消Horizontal ScrollBar显示
      webview.getSettings().setBuiltInZoomControls(true); // 显示放大缩小 controler
      webview.getSettings().setSupportZoom(true); // 可以缩放
      setZoomControlGone(webview); // 去掉zoom按钮

      if (doubleClickEabled) { // 双击缩放
        webview.getSettings().setUseWideViewPort(true);
        webview.getSettings().setLoadWithOverviewMode(true);
      }
      webview.setSaveEnabled(true);
    }
  }
コード例 #27
0
  private void initUI() {

    deleteDatabase("webview");
    mWebView = (WebView) findViewById(R.id.webview);

    String channel = MyUtils.getChannel(this);

    mWebView.requestFocusFromTouch();
    mWebView.setVerticalScrollBarEnabled(false);
    mWebView.setHorizontalScrollBarEnabled(false);
    mWebView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setAllowFileAccess(true);
    mWebView.getSettings().setSupportZoom(true);
    mWebView.getSettings().setBuiltInZoomControls(true);
    mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    mWebView.getSettings().setUserAgentString("Android365/test");

    mWebView.setWebChromeClient(webChromeClient);

    //		mWebView.requestFocusFromTouch();
    //		mWebView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
    //		mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    //		mWebView.getSettings().setUserAgentString(NetworkControl.CLIENT_USER_AGENT + "/" + channel +
    // " " + getString(R.string.mversion));
    //		mWebView.setWebChromeClient(webChromeClient);
    //
    //		WebSettings settings = mWebView.getSettings();
    //		settings.setJavaScriptEnabled(true);
    //		if (android.os.Build.VERSION.SDK_INT < 8) {
    //			settings.setPluginsEnabled(true);
    //		} else {
    //			settings.setPluginState(WebSettings.PluginState.ON);
    //		}
    //		settings.setSupportZoom(true);
    //		settings.setBuiltInZoomControls(true);
    //		settings.setAllowFileAccess(true);
    // settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
    // settings.setUseWideViewPort(true);

    //		if(android.os.Build.VERSION.SDK_INT >= 8){
    //			settings.setLoadWithOverviewMode(true);
    //			settings.setDatabaseEnabled(true);
    //			settings.setDomStorageEnabled(true);
    //			settings.setGeolocationEnabled(true);
    //			settings.setAppCacheEnabled(true);
    //		}
    //
    //		if (android.os.Build.VERSION.SDK_INT >= 11) {
    //			Method method;
    //			try {
    //				method = WebSettings.class.getDeclaredMethod(	"setDisplayZoomControls",
    //																boolean.class);
    //				method.setAccessible(true);
    //				method.invoke(settings, false);
    //			}
    //			catch (Exception e) {
    //			}
    //		}

    follow = (CheckBox) findViewById(R.id.follow);
    progressBar = (ProgressBar) findViewById(R.id.progress_bar);

    bottom = (RelativeLayout) findViewById(R.id.bottom);
    if (show) {

      bottom.setVisibility(View.VISIBLE);
      hint = (TextView) findViewById(R.id.hint);

      hint.setText(Html.fromHtml("<u>" + getString(R.string.follow_hint) + "</u>"));
      hint.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              Intent intent = new Intent();
              intent.setClass(ThirdPartyAccoutActivity.this, BindHint.class);
              startActivity(intent);
            }
          });

      follow.setText(followStr);
      follow.setChecked(true);
    } else {
      bottom.setVisibility(View.GONE);
    }
  }
コード例 #28
0
ファイル: TW.java プロジェクト: Hoth/Dino
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tw);
    WebView web = (WebView) findViewById(R.id.webapp);
    web.getSettings().setJavaScriptEnabled(true);
    /*
    // 스크롤바 없애기
    try {
        String accessToken = Util.getAppPreferences(this, Constants.TWITTER_ACCESS_TOKEN);
         String accessTokenSecret = Util.getAppPreferences(this, Constants.TWITTER_ACCESS_TOKEN_SECRET);
        Log.d("TAG", "accessToken : " + accessToken + "// accessTokenSecret : " + accessTokenSecret);

        if (accessToken != null && !"".equals(accessToken) && accessTokenSecret != null && !"".equals(accessTokenSecret)
                 && !accessToken.equals("STATE_IS_LOGOUT") && !accessTokenSecret.equals("STATE_IS_LOGOUT")) {
             // 로그인 되어 있다면!!!
             Log.d("TAG", " 로그인 되어 있다!!!");
            mAccessToken = new AccessToken(accessToken, accessTokenSecret);
             Log.v(Constants.LOG_TAG, "accessToken : " + mAccessToken.getToken());
            Log.v(Constants.LOG_TAG, "accessTokenSecret : " + mAccessToken.getTokenSecret());
         } else if ((accessToken.equals("STATE_IS_LOGOUT") && accessTokenSecret.equals("STATE_IS_LOGOUT")) || true) {
            // 로그인이 안되어 있다거나, 로그아웃을 했을 경우!!
             Log.d("TAG", "로그인 하자!!");
             ConfigurationBuilder cb = new ConfigurationBuilder();
            cb.setDebugEnabled(true);
             cb.setOAuthConsumerKey(Constants.TWITTER_CONSUMER_KEY);
             cb.setOAuthConsumerSecret(Constants.TWITTER_CONSUMER_SECRET);
             TwitterFactory factory = new TwitterFactory(cb.build());
             mTwitter = factory.getInstance();
             mRqToken = mTwitter.getOAuthRequestToken(Constants.TWITTER_CALLBACK_URL);
             Log.v(Constants.LOG_TAG, "AuthorizationURL >>>>>>>>>>>>>>> " + mRqToken.getAuthorizationURL());

             Intent intent = new Intent(this, TwitterLogin.class);
             intent.putExtra("auth_url", mRqToken.getAuthorizationURL());
             startActivityForResult(intent, Constants.TWITTER_LOGIN_CODE);
        }
     } catch (Exception e) {
         Log.d("TAG", e.getMessage());
         e.printStackTrace();
     }
    */

    web.setHorizontalScrollBarEnabled(false);
    web.setVerticalScrollBarEnabled(false);
    web.setBackgroundColor(0);

    web.setWebViewClient(
        new WebViewClient() {

          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
            // TODO Auto-generated method stub
            view.loadUrl(url);
            return true;
          }
        });

    try {
      web.loadUrl("http://m.twitter.com");
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    // TODO Auto-generated method stub
  }
コード例 #29
0
  @Override
  protected void onStart() {
    super.onStart();

    try {
      jsonSrc = FileUtils.readFromAssetsFile(that, "json2.js");
      androidJsSrc = FileUtils.readFromAssetsFile(that, "android.js");
    } catch (IOException e1) {
      throw new RuntimeException(e1);
    }

    mObserver = new HtmlEventObserver();

    // TODO
    // RpcReceiverManager mFacadeManager = getRpcReceiverManager();
    // mFacadeManager.getReceiver(EventFacade.class).addGlobalEventObserver(mObserver);
    // mAPIWrapperSource = generateAPIWrapper();

    PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
    mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, config.getLOG_TAG());
    mWebView.setKeepScreenOn(true);

    mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    mWebView.setScrollbarFadingEnabled(false);
    mWebView.setVerticalScrollBarEnabled(false);
    mWebView.setHorizontalScrollBarEnabled(false);
    mWebView.setScrollContainer(false);

    WebSettings webSettings = mWebView.getSettings();
    webSettings.setSavePassword(false);
    webSettings.setSaveFormData(false);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setPluginsEnabled(true);

    webSettings.setSupportZoom(false);
    webSettings.setSupportZoom(true);
    webSettings.setBuiltInZoomControls(true);
    webSettings.setUseWideViewPort(true);
    webSettings.setLoadWithOverviewMode(true);

    mWebView.addJavascriptInterface(mWrapper, "_rpc_wrapper");
    mWebView.addJavascriptInterface(
        new Object() {

          @SuppressWarnings("unused")
          public void register(String event, int id) {
            mObserver.register(event, id);
          }
        },
        "_callback_wrapper");

    if (Build.VERSION.SDK_INT >= 5) {
      try {
        Method m1 = WebSettings.class.getMethod("setDomStorageEnabled", new Class[] {Boolean.TYPE});
        m1.invoke(webSettings, Boolean.TRUE);

        Method m2 = WebSettings.class.getMethod("setDatabaseEnabled", new Class[] {Boolean.TYPE});
        m2.invoke(webSettings, Boolean.TRUE);

        Method m3 = WebSettings.class.getMethod("setDatabasePath", new Class[] {String.class});
        m3.invoke(webSettings, this.getFilesDir().getParent() + "/databases/");
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    mWebView.setWebChromeClient(new WebChromeClient() {});

    mWebView.setWebViewClient(
        new WebViewClient() {
          //        	public void onReceivedError(WebView view, int errorCode, String description,
          // String failingUrl) {
          //        		Toast.makeText(that, "Error: " + description, Toast.LENGTH_SHORT).show();
          //        	}
        });

    webSettings.setCacheMode(WebSettings.LOAD_NORMAL);

    if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT < 14) {
      mWebView.setSystemUiVisibility(WebView.STATUS_BAR_HIDDEN);
    } else if (Build.VERSION.SDK_INT >= 14) {
      mWebView.setSystemUiVisibility(WebView.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    }

    mWebView.loadUrl("javascript:" + jsonSrc);
    mWebView.loadUrl("javascript:" + androidJsSrc);
    mWebView.loadUrl("javascript:" + mAPIWrapperSource);
    Log.d(
        config.getLOG_TAG(),
        "Launch Webview: "
            + "file://"
            + this.getFilesDir().getAbsolutePath()
            + "/"
            + config.getMAIN_SCRIPT_NAME());
    mWebView.loadUrl(
        "file://" + this.getFilesDir().getAbsolutePath() + "/" + config.getMAIN_SCRIPT_NAME());
  }
コード例 #30
0
  @SuppressLint("SetJavaScriptEnabled")
  @Override
  public View getView(int position, View contentView, ViewGroup parent) {
    info = this.getItem(position);
    View rowView = this.viewMap.get(position);
    if (rowView == null) {
      try {

        LayoutInflater inflater = ((Activity) this.getContext()).getLayoutInflater();
        rowView = inflater.inflate(R.layout.list_items, null);

        // 屏蔽转发
        rowView.findViewById(R.id.forwardCount).setVisibility(View.INVISIBLE);
        rowView.findViewById(R.id.forwardCount2).setVisibility(View.INVISIBLE);
        rowView.findViewById(R.id.forwardCount_img).setVisibility(View.INVISIBLE);
        rowView.findViewById(R.id.forwardCount2_img).setVisibility(View.INVISIBLE);

        TextView username = (TextView) rowView.findViewById(R.id.username);
        username.setText(info.getUser().getUserName());
        username.getPaint().setFakeBoldText(true);

        TextView blogText = (TextView) rowView.findViewById(R.id.comment);
        blogText.setText(
            new ShareActivity(context)
                .imgReplaceText(
                    blogText, info.getLiveBlog().getBlogContent(), context, false)); // 转换表情

        if (info.getLiveBlog().getBlogPic() != null
            && !"".equals(info.getLiveBlog().getBlogPic())) {
          WebView imgThumb = (WebView) rowView.findViewById(R.id.imgThumb);
          imgThumb.setVisibility(View.VISIBLE);
          imgThumb.setHorizontalScrollBarEnabled(false);
          imgThumb.setVerticalScrollBarEnabled(false);
          imgThumb.setFocusable(false);
          imgThumb.setBackgroundColor(0);
          imgThumb.getSettings().setJavaScriptEnabled(true);
          imgThumb.addJavascriptInterface(this, "miblogscript");

          // 在引解析缩略图地址
          String[] tempImgPath = info.getLiveBlog().getBlogPic().split(",");
          String thumbPic =
              info.getLiveBlog().getLargePic().replace(tempImgPath[0], tempImgPath[1]);
          info.getLiveBlog().setThumbPic(thumbPic);

          imgThumb.loadDataWithBaseURL(
              null,
              MyMethods.getHtmlWithA(
                  info.getLiveBlog().getLargePic(), info.getLiveBlog().getThumbPic()),
              "text/html",
              "UTF-8",
              null);

          ImageView pic = (ImageView) rowView.findViewById(R.id.pic);
          pic.setVisibility(View.VISIBLE);
        }

        if (info.getLiveBlog().getOrigBlog() != null) {
          TextView quote = (TextView) rowView.findViewById(R.id.quote);
          TextView quotename = (TextView) rowView.findViewById(R.id.quotename);

          rowView.findViewById(R.id.quotelayou).setVisibility(View.VISIBLE);
          rowView.findViewById(R.id.quote_bg1).setVisibility(View.VISIBLE);
          rowView.findViewById(R.id.quote_bg2).setVisibility(View.VISIBLE);
          quote.setText(
              new ShareActivity(context).imgReplaceText(quote, "被转发的内容", context, false)); // 转换表情

          quotename.setVisibility(View.VISIBLE);
          quotename.setText("名字需要重新定义");
          ShareActivity.otherUserInfo(quotename, 100, this.getContext());

          WebView iii = (WebView) rowView.findViewById(R.id.forwordimgThumb);
          iii.setHorizontalScrollBarEnabled(false);
          iii.setVerticalScrollBarEnabled(false);
          iii.setFocusable(false);
          iii.setBackgroundColor(Color.parseColor("#EEEEEE"));
          iii.getSettings().setJavaScriptEnabled(true);
          iii.addJavascriptInterface(this, "miblogscript");
          iii.loadDataWithBaseURL(
              null,
              MyMethods.getHtmlWithA(
                  info.getLiveBlog().getOrigBlog().getBlogPic(),
                  info.getLiveBlog().getOrigBlog().getLargePic()),
              "text/html",
              "UTF-8",
              null);

          //	TextView resendcount2 = (TextView) rowView.findViewById(R.id.forwardCount2);
          TextView replaycount2 = (TextView) rowView.findViewById(R.id.replyCount2);
          //	resendcount2.setText("11");
          replaycount2.setText("21");
        } else {
          rowView.findViewById(R.id.quotelayou).setVisibility(View.GONE);
          rowView.findViewById(R.id.quote_bg1).setVisibility(View.GONE);
          rowView.findViewById(R.id.quote_bg2).setVisibility(View.GONE);
        }

        TextView comefrom = (TextView) rowView.findViewById(R.id.comefrom);
        comefrom.setText(info.getLiveBlog().getSourceFrom());

        TextView time = (TextView) rowView.findViewById(R.id.time);
        time.setText(info.getLiveBlog().getCreateTime());

        rowView.findViewById(R.id.statCount).setVisibility(View.VISIBLE);
        // TextView resendcount = (TextView) rowView.findViewById(R.id.forwardCount);
        TextView replaycount = (TextView) rowView.findViewById(R.id.replyCount);
        // resendcount.setText(info.getLiveBlog().getForwardNum() + "");
        replaycount.setText(info.getLiveBlog().getCommentNum() + "");
        // 头像

        WebView imageView = (WebView) rowView.findViewById(R.id.ItemWebImage);
        imageView.getSettings().setJavaScriptEnabled(true);
        imageView.setBackgroundColor(Color.parseColor("#EEEEEE"));
        imageView.setHorizontalScrollBarEnabled(false);
        imageView.setVerticalScrollBarEnabled(false);
        imageView.setFocusable(false);
        imageView.loadDataWithBaseURL(
            null, MyMethods.getHtml(info.getUser().getUserPic()), "text/html", "UTF-8", null);
      } catch (Exception e) {
        e.printStackTrace();
      }
      viewMap.put(position, rowView);
    }
    return viewMap.get(position);
  }