diff --git a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/FbWrapper.java b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/FbWrapper.java index 3a578da..fb370b2 100644 --- a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/FbWrapper.java +++ b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/FbWrapper.java @@ -13,9 +13,10 @@ import android.support.v4.widget.DrawerLayout; import android.text.TextUtils; import android.view.KeyEvent; -import android.view.View; import android.widget.RelativeLayout; + import com.danvelazco.fbwrapper.activity.BaseFacebookWebViewActivity; +import com.danvelazco.fbwrapper.activity.DrawerFragment; import com.danvelazco.fbwrapper.preferences.FacebookPreferences; import com.danvelazco.fbwrapper.util.Logger; import com.danvelazco.fbwrapper.util.OrbotHelper; @@ -33,6 +34,8 @@ public class FbWrapper extends BaseFacebookWebViewActivity { private DrawerLayout mDrawerLayout = null; private RelativeLayout mWebViewContainer = null; private String mDomainToUse = INIT_URL_MOBILE; + private String mDomainSuffix = INIT_URL_MOBILE_SUFFIX; + // Preferences stuff private SharedPreferences mSharedPreferences = null; @@ -49,10 +52,10 @@ protected void onActivityCreated() { // Keep a reference of the DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.layout_main); + getFragmentManager().beginTransaction().replace(R.id.drawerFragment, new DrawerFragment()).commit(); mWebViewContainer = (RelativeLayout) findViewById(R.id.webview_container); // Set the click listener interface for the buttons - setOnClickListeners(); } /** @@ -110,7 +113,7 @@ protected void onWebViewInit(Bundle savedInstanceState) { } else { // Load the URL depending on the type of device or preference Logger.d(LOG_TAG, "Loading the init Facebook URL"); - loadNewPage(mDomainToUse); + loadNewPage(mDomainToUse + mDomainSuffix); } } @@ -129,30 +132,10 @@ protected void onResumeActivity() { // If the domain changes, reload the page with the new domain if (!mDomainToUse.equalsIgnoreCase(previousDomainUsed)) { - loadNewPage(mDomainToUse); + loadNewPage(mDomainToUse + mDomainSuffix); } } - /** - * Sets the click listener on all the buttons in the activity - */ - private void setOnClickListeners() { - // Create a new listener - MenuDrawerButtonListener buttonsListener = new MenuDrawerButtonListener(); - - // Set this listener to all the buttons - findViewById(R.id.menu_drawer_right).setOnClickListener(buttonsListener); - findViewById(R.id.menu_item_jump_to_top).setOnClickListener(buttonsListener); - findViewById(R.id.menu_item_refresh).setOnClickListener(buttonsListener); - findViewById(R.id.menu_item_newsfeed).setOnClickListener(buttonsListener); - findViewById(R.id.menu_items_notifications).setOnClickListener(buttonsListener); - findViewById(R.id.menu_item_messages).setOnClickListener(buttonsListener); - findViewById(R.id.menu_share_this).setOnClickListener(buttonsListener); - findViewById(R.id.menu_preferences).setOnClickListener(buttonsListener); - findViewById(R.id.menu_about).setOnClickListener(buttonsListener); - findViewById(R.id.menu_kill).setOnClickListener(buttonsListener); - } - /** * Used to open the menu drawer */ @@ -245,22 +228,22 @@ private void loadPreferences() { // Force or detect the site mode to load if (mode.equalsIgnoreCase(FacebookPreferences.SITE_MODE_MOBILE)) { // Force the webview config to mobile - setupFacebookWebViewConfig(true, true, false, false, false); + setupFacebookWebViewConfig(MOBILE); } else if (mode.equalsIgnoreCase(FacebookPreferences.SITE_MODE_DESKTOP)) { // Force the webview config to desktop mode - setupFacebookWebViewConfig(true, false, false, false, false); + setupFacebookWebViewConfig(DESKTOP); } else if (mode.equalsIgnoreCase(FacebookPreferences.SITE_MODE_ZERO)) { // Force the webview config to zero mode - setupFacebookWebViewConfig(false, true, false, true, false); + setupFacebookWebViewConfig(ZERO); } else if (mode.equalsIgnoreCase(FacebookPreferences.SITE_MODE_BASIC)) { // Force the webview to load the Basic HTML Mobile site - setupFacebookWebViewConfig(true, true, true, false, false); + setupFacebookWebViewConfig(BASIC); } else if (mode.equalsIgnoreCase(FacebookPreferences.SITE_MODE_ONION)) { // Force the webview to load Facebook via Tor (onion network) - setupFacebookWebViewConfig(true, true, false, false, true); + setupFacebookWebViewConfig(ONION); } else { // Do not force, allow us to auto-detect what mode to use - setupFacebookWebViewConfig(false, true, false, false, false); + } // If we haven't shown the new menu drawer to the user, auto open it @@ -278,35 +261,39 @@ private void loadPreferences() { /** * Configure this {@link com.danvelazco.fbwrapper.webview.FacebookWebView} * with the appropriate preferences depending on the device configuration.
- * Use the 'force' flag to force the configuration to either mobile or desktop. * - * @param force {@link boolean} - * whether to force the configuration or not, - * if false the 'mobile' flag will be ignored - * @param mobile {@link boolean} - * whether to use the mobile or desktop site. - * @param facebookZero {@link boolean} - * whether or not to use Facebook Zero + * @param domainType {@link int} Which URL type we are using. */ - // TODO: time to fix this mess - private void setupFacebookWebViewConfig(boolean force, boolean mobile, boolean facebookBasic, - boolean facebookZero, boolean facebookOnion) { - if (force && !mobile) { - // Force the desktop site to load - mDomainToUse = INIT_URL_DESKTOP; - } else if (facebookZero) { - // If Facebook zero is set, use that - mDomainToUse = INIT_URL_FACEBOOK_ZERO; - } else if (facebookOnion) { - // If the Onion domain is set, use that - mDomainToUse = INIT_URL_FACEBOOK_ONION; - } else { - // Otherwise, just load the mobile site for all devices - mDomainToUse = INIT_URL_MOBILE; + private void setupFacebookWebViewConfig(int domainType) { + switch (domainType) { + case DESKTOP: + // Force the desktop site to load + mDomainToUse = INIT_URL_DESKTOP; + mDomainSuffix = INIT_URL_NORMAL_SUFFIX; + break; + case ZERO: + // If Facebook zero is set, use that + mDomainToUse = INIT_URL_FACEBOOK_ZERO; + mDomainSuffix = INIT_URL_NORMAL_SUFFIX; + break; + case ONION: + // If the Onion domain is set, use that + mDomainToUse = INIT_URL_FACEBOOK_ONION; + mDomainSuffix = INIT_URL_NORMAL_SUFFIX; + break; + case BASIC: + // Found a URL that can replace the Firefox for Android UA + mDomainToUse = INIT_URL_FACEBOOK_BASIC; + mDomainSuffix = INIT_URL_NORMAL_SUFFIX; + break; + case MOBILE: + mDomainSuffix = INIT_URL_MOBILE_SUFFIX; + // Otherwise, just load the mobile site for all devices + break; } // Set the user agent depending on config - setUserAgent(force, mobile, facebookBasic); + setUserAgent(domainType); } /** @@ -335,48 +322,41 @@ private boolean isDeviceTablet() { return isTablet; } - /** - * Menu drawer button listener interface - */ - private class MenuDrawerButtonListener implements View.OnClickListener { - /** - * {@inheritDoc} - */ - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.menu_item_jump_to_top: + public void drawerClick(int position) { + switch (position) { + case 0: jumpToTop(); break; - case R.id.menu_item_refresh: + case 1: refreshCurrentPage(); break; - case R.id.menu_item_newsfeed: - loadNewPage(mDomainToUse + "?sk=h_chr"); + case 2: + loadNewPage(mDomainToUse + mDomainSuffix); break; - case R.id.menu_items_notifications: + case 3: loadNewPage(mDomainToUse + URL_PAGE_NOTIFICATIONS); break; - case R.id.menu_item_messages: + case 4: loadNewPage(mDomainToUse + URL_PAGE_MESSAGES); break; - case R.id.menu_share_this: + case 5: shareCurrentPage(); break; - case R.id.menu_preferences: + case 6: startActivity(new Intent(FbWrapper.this, FacebookPreferences.class)); + break; - case R.id.menu_about: + case 7: showAboutAlert(); break; - case R.id.menu_kill: + case 8: mWebViewContainer.removeView(mWebView); destroyWebView(); finish(); break; } closeMenuDrawer(); - } + } /** @@ -384,6 +364,8 @@ public void onClick(View v) { */ private void showAboutAlert() { AlertDialog alertDialog = new AlertDialog.Builder(this).create(); + + alertDialog.setTitle(getString(R.string.menu_about)); alertDialog.setMessage(getString(R.string.txt_about)); alertDialog.setIcon(R.drawable.ic_launcher); @@ -417,4 +399,5 @@ public boolean onKeyDown(int keyCode, KeyEvent event) { return super.onKeyDown(keyCode, event); } + } diff --git a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/BaseFacebookWebViewActivity.java b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/BaseFacebookWebViewActivity.java index ca7ca0c..4be19a6 100644 --- a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/BaseFacebookWebViewActivity.java +++ b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/BaseFacebookWebViewActivity.java @@ -65,7 +65,7 @@ * Base activity that uses a {@link FacebookWebView} to load the Facebook * site in different formats. Here we can implement all the boilerplate code * that has to do with loading the activity as well as lifecycle events. - *

+ *

* See {@link #onActivityCreated()} * See {@link #onWebViewInit(android.os.Bundle)} * See {@link #onResumeActivity()} @@ -82,9 +82,18 @@ public abstract class BaseFacebookWebViewActivity extends Activity implements protected final static String INIT_URL_MOBILE = "https://m.facebook.com"; protected final static String INIT_URL_DESKTOP = "https://www.facebook.com"; protected final static String INIT_URL_FACEBOOK_ZERO = "https://0.facebook.com"; + protected final static String INIT_URL_FACEBOOK_BASIC = "https://mbasic.facebook.com/"; protected final static String INIT_URL_FACEBOOK_ONION = "https://facebookcorewwwi.onion"; + // Because Facebook's new mobile site needs the /home.php to properly force Most Recent. + protected final static String INIT_URL_NORMAL_SUFFIX = "?sk=h_chr"; + protected final static String INIT_URL_MOBILE_SUFFIX = "/home.php?sk=h_chr"; protected final static String URL_PAGE_NOTIFICATIONS = "/notifications.php"; protected final static String URL_PAGE_MESSAGES = "/messages"; + protected final static int ZERO = 0; + protected final static int BASIC = 1; + protected final static int DESKTOP = 2; + protected final static int MOBILE = 3; + protected final static int ONION = 4; // URL for Sharing Links // u = url & t = title @@ -99,8 +108,6 @@ public abstract class BaseFacebookWebViewActivity extends Activity implements // Mobile user agent (Mobile user agent from a Google Nexus 5 running Android 4.4.2 protected static final String USER_AGENT_MOBILE = "Mozilla/5.0 (Linux; Android 5.0; Nexus 5 Build/LRX21O) " + "AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile Safari/537.36"; - // Firefox for Android user agent, it brings up a basic version of the site. Halfway between touch site and zero site. - protected static final String USER_AGENT_BASIC = "Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0"; // Members protected ConnectivityManager mConnectivityManager = null; @@ -309,31 +316,24 @@ protected void restoreWebView(Bundle inState) { } /** - * Set the browser user agent to be used. If the user agent should be forced, - * make sure the 'force' param is set to true, otherwise the devices' default - * user agent will be used. + * Set the browser user agent to be used. * - * @param force {@link boolean} - * true if we should force a custom user agent, false if not. - * Note, if this flag is false the default user agent will be - * used while disregarding the mobile {@link boolean} parameter - * @param mobile {@link boolean} - * true if we should use a custom user agent for mobile devices, - * false if not. - */ - protected void setUserAgent(boolean force, boolean mobile, boolean facebookBasic) { - if (force && mobile && !facebookBasic) { + * @param type {@link int} Which user agent to use. + * + */ + protected void setUserAgent(int type) { + if (type == MOBILE) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) { mWebSettings.setUserAgentString(USER_AGENT_MOBILE_OLD); } else { mWebSettings.setUserAgentString(USER_AGENT_MOBILE); } - } else if (force && !mobile && !facebookBasic) { + } else if (type == DESKTOP) { mWebSettings.setUserAgentString(USER_AGENT_DESKTOP); - } else if (force && mobile && facebookBasic) { - mWebSettings.setUserAgentString(USER_AGENT_BASIC); - } else { - mWebSettings.setUserAgentString(null); + } + // Basic, Onion, Auto and Zero do not need a user agent, so use the system default. + else { + mWebSettings.setUserAgentString(WebSettings.getDefaultUserAgent(this)); } } diff --git a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/DrawerFragment.java b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/DrawerFragment.java new file mode 100644 index 0000000..64e7161 --- /dev/null +++ b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/activity/DrawerFragment.java @@ -0,0 +1,57 @@ +package com.danvelazco.fbwrapper.activity; + +import android.app.ListFragment; +import android.content.res.TypedArray; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ListView; + +import com.danvelazco.fbwrapper.FbWrapper; +import com.danvelazco.fbwrapper.R; +import com.danvelazco.fbwrapper.util.MySimpleArrayAdapter; + +/** + * A ListFragment that replaces the million OnClickListeners previously used in the Drawer. + */ +public class DrawerFragment extends ListFragment { + private String[] mPlanetTitles; + private int[] mIcons; + + + + public DrawerFragment() {} + @Override + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + inflater.inflate(R.layout.drawer_fragment, container, false); + + mPlanetTitles = getResources().getStringArray(R.array.drawer_items); + TypedArray ar = getResources().obtainTypedArray(R.array.drawer_item_icons); + int len = ar.length(); + mIcons = new int[len]; + for (int i = 0; i < len; i++) + mIcons[i] = ar.getResourceId(i, 0); + + ar.recycle(); + // Set the adapter for the list view + setListAdapter(new MySimpleArrayAdapter(getActivity(), mPlanetTitles, mIcons)); + // Set the list's click listener + + return super.onCreateView(inflater, container, savedInstanceState); + } + @Override + public void onViewCreated(View v, Bundle savedInstanceState) { + super.onViewCreated(v, savedInstanceState); + getListView().setDividerHeight(0); + getListView().setDivider(new ColorDrawable(android.R.color.transparent)); + } + @Override + public void onListItemClick(ListView l, View view, int position, long id) { + ((FbWrapper)getActivity()).drawerClick(position); + } + +} diff --git a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/util/MySimpleArrayAdapter.java b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/util/MySimpleArrayAdapter.java new file mode 100644 index 0000000..4089fea --- /dev/null +++ b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/util/MySimpleArrayAdapter.java @@ -0,0 +1,37 @@ +package com.danvelazco.fbwrapper.util; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import com.danvelazco.fbwrapper.R; + +public class MySimpleArrayAdapter extends ArrayAdapter { + private final Context context; + private final String[] values; + private final int[] pics; + + public MySimpleArrayAdapter(Context context, String[] values, int[] pics) { + super(context, R.layout.drawer_list_item, values); + this.context = context; + this.values = values; + this.pics = pics; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + LayoutInflater inflater = (LayoutInflater) context + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View rowView = inflater.inflate(R.layout.drawer_list_item, parent, false); + TextView textView = (TextView) rowView.findViewById(R.id.drawer_item_text); + ImageView imageView = (ImageView) rowView.findViewById(R.id.drawer_item_icon); + textView.setText(values[position]); + imageView.setImageResource(pics[position]); + + return rowView; + } +} \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebView.java b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebView.java index 10c84c0..0be4e54 100644 --- a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebView.java +++ b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebView.java @@ -40,7 +40,7 @@ public class FacebookWebView extends WebView { final boolean DEFAULT_DOM_STORAGE_ENABLED = true; final boolean DEFAULT_ALLOW_GEOLOCATION = false; final boolean DEFAULT_ALLOW_FILE_UPLOAD = true; - final boolean DEFAULT_WIDE_VIEWPORT = false; + final boolean DEFAULT_WIDE_VIEWPORT = true; final boolean DEFAULT_LOAD_WITH_OVERVIEW_MODE = true; final int DEFAULT_CACHE_MODE = WebSettings.LOAD_DEFAULT; final WebSettings.RenderPriority DEFAULT_RENDER_PRIORITY = WebSettings.RenderPriority.HIGH; diff --git a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebViewClient.java b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebViewClient.java index 32b4fb7..e0f563c 100644 --- a/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebViewClient.java +++ b/Tinfoil-for-Facebook/src/main/java/com/danvelazco/fbwrapper/webview/FacebookWebViewClient.java @@ -26,12 +26,14 @@ import com.danvelazco.fbwrapper.util.Logger; /** - * FacebookWebViewClient.
- * Extends {@link android.webkit.WebViewClient}.
+ * FacebookWebViewClient.
+ * Extends {@link android.webkit.WebViewClient}.
* Used by {@link FacebookWebView}. */ public class FacebookWebViewClient extends WebViewClient { + private String TAG = getClass().getSimpleName(); + // Members private WebViewClientListener mListener = null; private boolean mAllowAnyUrl = false; @@ -68,10 +70,10 @@ public void setAllowAnyDomain(boolean allow) { */ @Override public void onReceivedError(WebView view, int errorCod, String description, String failingUrl) { - Logger.e(getClass().getSimpleName(), "This WebView has received an error while trying to load:"); - Logger.e(getClass().getSimpleName(), "\tError code: " + errorCod); - Logger.e(getClass().getSimpleName(), "\tDescription: " + description); - Logger.e(getClass().getSimpleName(), "\tFailed URL: " + failingUrl); + Logger.e(TAG, "This WebView has received an error while trying to load:"); + Logger.e(TAG, "\tError code: " + errorCod); + Logger.e(TAG, "\tDescription: " + description); + Logger.e(TAG, "\tFailed URL: " + failingUrl); } /** @@ -97,31 +99,31 @@ public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) { */ @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { - Logger.d(getClass().getSimpleName(), "shouldOverrideUrlLoading? " + url); + Logger.d(TAG, "shouldOverrideUrlLoading? " + url); // Do not override any type of loading if we can load any URL if (mAllowAnyUrl) { - Logger.d(getClass().getSimpleName(), "The user is allowing us to open any URL in this WebView, let it load."); + Logger.d(TAG, "The user is allowing us to open any URL in this WebView, let it load."); return false; } // Avoid NPEs when clicking on weird blank links if (url.equals("about:blank")) { - Logger.d(getClass().getSimpleName(), "Blank page, let it load"); + Logger.d(TAG, "Blank page, let it load"); return false; } // Get the URL's domain name String domain = Uri.parse(url).getHost(); - Logger.d(getClass().getSimpleName(), "Checking URL: " + url); - Logger.d(getClass().getSimpleName(), "\tDomain: " + domain); + Logger.d(TAG, "Checking URL: " + url); + Logger.d(TAG, "\tDomain: " + domain); if (domain != null) { // Let this WebView open the URL // TODO: Check the proper domain names that facebook uses or find another way if (domain.contains("facebook") || domain.contains("fb")) { - Logger.d(getClass().getSimpleName(), "This URL should be loaded internally. Let it load."); + Logger.d(TAG, "This URL should be loaded internally. Let it load."); view.loadUrl(url); return false; } @@ -129,7 +131,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) { // Otherwise, fire the listener to open the URL by // any app that can handle it - Logger.d(getClass().getSimpleName(), "This URL should be loaded by a 3rd party. Override."); + Logger.d(TAG, "This URL should be loaded by a 3rd party. Override."); fireOpenExternalSiteListener(url); return true; diff --git a/Tinfoil-for-Facebook/src/main/res/layout/drawer_fragment.xml b/Tinfoil-for-Facebook/src/main/res/layout/drawer_fragment.xml new file mode 100644 index 0000000..5d9ab33 --- /dev/null +++ b/Tinfoil-for-Facebook/src/main/res/layout/drawer_fragment.xml @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/res/layout/drawer_list_item.xml b/Tinfoil-for-Facebook/src/main/res/layout/drawer_list_item.xml new file mode 100644 index 0000000..debe7e2 --- /dev/null +++ b/Tinfoil-for-Facebook/src/main/res/layout/drawer_list_item.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/res/layout/drawer_menu.xml b/Tinfoil-for-Facebook/src/main/res/layout/drawer_menu.xml index 734badf..9af44e8 100644 --- a/Tinfoil-for-Facebook/src/main/res/layout/drawer_menu.xml +++ b/Tinfoil-for-Facebook/src/main/res/layout/drawer_menu.xml @@ -13,331 +13,56 @@ See the License for the specific language governing permissions and limitations under the License. --> - + android:orientation="vertical"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_height="@dimen/navigation_drawer_items_height" + android:background="@color/mild_gray" + android:padding="@dimen/navigation_drawer_items_padding"> + + + + + + + + - - + \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/res/layout/main_layout.xml b/Tinfoil-for-Facebook/src/main/res/layout/main_layout.xml index bce0f7b..5a29c32 100644 --- a/Tinfoil-for-Facebook/src/main/res/layout/main_layout.xml +++ b/Tinfoil-for-Facebook/src/main/res/layout/main_layout.xml @@ -15,9 +15,9 @@ limitations under the License. --> @@ -34,16 +34,17 @@ android:layout_height="match_parent" android:fadeScrollbars="true" android:focusable="true" - android:focusableInTouchMode="true" /> + android:focusableInTouchMode="true"/> + + android:layout_alignParentTop="true" + android:layout_marginTop="@dimen/webview_top_progress_bar_top_margin"/> @@ -53,9 +54,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" - android:visibility="gone" /> + android:visibility="gone"/> - + \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/res/layout/video_loading_progress.xml b/Tinfoil-for-Facebook/src/main/res/layout/video_loading_progress.xml index 7af108f..369f5d4 100644 --- a/Tinfoil-for-Facebook/src/main/res/layout/video_loading_progress.xml +++ b/Tinfoil-for-Facebook/src/main/res/layout/video_loading_progress.xml @@ -15,28 +15,28 @@ limitations under the License. --> + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:orientation="vertical"> + android:layout_height="wrap_content" + android:layout_gravity="center"/> + android:textColor="@color/light_gray" + android:textSize="@dimen/loading_video_text_size"/> \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/res/values/arrays.xml b/Tinfoil-for-Facebook/src/main/res/values/arrays.xml new file mode 100644 index 0000000..6ba4f53 --- /dev/null +++ b/Tinfoil-for-Facebook/src/main/res/values/arrays.xml @@ -0,0 +1,28 @@ + + + + + @string/menu_jump_top + @string/menu_refresh + @string/menu_news_feed + @string/menu_notifications + @string/menu_messages + @string/menu_share + @string/menu_preferences + @string/menu_about + @string/menu_exit + + + + + @android:drawable/ic_menu_upload + @android:drawable/ic_menu_rotate + @android:drawable/ic_menu_view + @android:drawable/ic_menu_info_details + @android:drawable/ic_menu_edit + @android:drawable/ic_menu_share + @android:drawable/ic_menu_preferences + @android:drawable/ic_menu_help + @android:drawable/ic_menu_close_clear_cancel + + \ No newline at end of file diff --git a/Tinfoil-for-Facebook/src/main/res/values/dimensions.xml b/Tinfoil-for-Facebook/src/main/res/values/dimensions.xml index bd7b78e..0fc27a2 100644 --- a/Tinfoil-for-Facebook/src/main/res/values/dimensions.xml +++ b/Tinfoil-for-Facebook/src/main/res/values/dimensions.xml @@ -19,7 +19,7 @@ 16dp - -6dp + -7dp 5dip 14sp diff --git a/Tinfoil-for-Facebook/src/main/res/values/strings.xml b/Tinfoil-for-Facebook/src/main/res/values/strings.xml index ae4b153..ff9d2b9 100644 --- a/Tinfoil-for-Facebook/src/main/res/values/strings.xml +++ b/Tinfoil-for-Facebook/src/main/res/values/strings.xml @@ -46,7 +46,7 @@ Messages Preferences About - Kill + Exit Facebook access