Search in sources :

Example 1 with AwfulWebView

use of com.ferg.awfulapp.webview.AwfulWebView in project Awful.apk by Awful.

the class MessageFragment method onCreateView.

public View onCreateView(LayoutInflater aInflater, ViewGroup aContainer, Bundle aSavedState) {
    super.onCreateView(aInflater, aContainer, aSavedState);
    mPrefs = AwfulPreferences.getInstance(getActivity());
    setRetainInstance(true);
    View result = aInflater.inflate(R.layout.private_message_fragment, aContainer, false);
    messageWebView = (AwfulWebView) result.findViewById(R.id.messagebody);
    mHideButton = (ImageButton) result.findViewById(R.id.hide_message);
    mHideButton.setOnClickListener(this);
    mRecipient = (EditText) result.findViewById(R.id.message_user);
    mSubject = (EditText) result.findViewById(R.id.message_subject);
    mUsername = (TextView) result.findViewById(R.id.username);
    mPostdate = (TextView) result.findViewById(R.id.post_date);
    mTitle = (TextView) result.findViewById(R.id.message_title);
    messageComposer = (MessageComposer) getChildFragmentManager().findFragmentById(R.id.message_composer_fragment);
    mBackground = result;
    updateColors(result, mPrefs);
    messageWebView.setJavascriptHandler(new WebViewJsInterface());
    if (pmId <= 0) {
        messageWebView.setVisibility(GONE);
    } else {
        syncPM();
    }
    return result;
}
Also used : WebViewJsInterface(com.ferg.awfulapp.webview.WebViewJsInterface) View(android.view.View) TextView(android.widget.TextView) AwfulWebView(com.ferg.awfulapp.webview.AwfulWebView)

Example 2 with AwfulWebView

use of com.ferg.awfulapp.webview.AwfulWebView in project Awful.apk by Awful.

the class ThreadDisplayFragment method onCreateView.

// --------------------------------
@Override
public View onCreateView(LayoutInflater aInflater, ViewGroup aContainer, Bundle aSavedState) {
    View result;
    try {
        result = inflateView(R.layout.thread_display, aContainer, aInflater);
    } catch (InflateException e) {
        if (webViewIsMissing(e)) {
            return null;
        } else {
            throw e;
        }
    }
    pageBar = (PageBar) result.findViewById(R.id.page_bar);
    pageBar.setListener(new PageBar.PageBarCallbacks() {

        @Override
        public void onPageNavigation(boolean nextPage) {
            turnPage(nextPage);
        }

        @Override
        public void onRefreshClicked() {
            refresh();
        }

        @Override
        public void onPageNumberClicked() {
            displayPagePicker();
        }
    });
    getAwfulActivity().setPreferredFont(pageBar.getTextView());
    mThreadView = (AwfulWebView) result.findViewById(R.id.thread);
    initThreadViewProperties();
    mUserPostNotice = (TextView) result.findViewById(R.id.thread_userpost_notice);
    refreshProbationBar();
    // FAB
    mFAB = (FloatingActionButton) result.findViewById(R.id.just_post);
    mFAB.setOnClickListener(onButtonClick);
    mFAB.setVisibility(View.GONE);
    return result;
}
Also used : PageBar(com.ferg.awfulapp.widget.PageBar) InflateException(android.view.InflateException) View(android.view.View) WebView(android.webkit.WebView) TextView(android.widget.TextView) AwfulWebView(com.ferg.awfulapp.webview.AwfulWebView)

Example 3 with AwfulWebView

use of com.ferg.awfulapp.webview.AwfulWebView in project Awful.apk by Awful.

the class PreviewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View dialogView = inflateView(R.layout.post_preview, container, inflater);
    progressBar = (ProgressBar) dialogView.findViewById(R.id.preview_progress);
    postPreView = (AwfulWebView) dialogView.findViewById(R.id.post_pre_view);
    configureWebView();
    getDialog().setCanceledOnTouchOutside(true);
    postPreView.setContent(getBlankPage());
    return dialogView;
}
Also used : View(android.view.View) AwfulWebView(com.ferg.awfulapp.webview.AwfulWebView) WebView(android.webkit.WebView)

Aggregations

View (android.view.View)3 AwfulWebView (com.ferg.awfulapp.webview.AwfulWebView)3 WebView (android.webkit.WebView)2 TextView (android.widget.TextView)2 InflateException (android.view.InflateException)1 WebViewJsInterface (com.ferg.awfulapp.webview.WebViewJsInterface)1 PageBar (com.ferg.awfulapp.widget.PageBar)1