Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions app/src/main/java/com/danvelazco/fbwrapper/FbWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
Expand All @@ -27,7 +29,7 @@ public class FbWrapper extends BaseFacebookWebViewActivity {

// Constant
private final static String LOG_TAG = "FbWrapper";
private final static int MENU_DRAWER_GRAVITY = GravityCompat.END;
private final static int MENU_DRAWER_GRAVITY = GravityCompat.START;
protected final static int DELAY_RESTORE_STATE = (60 * 1000) * 30;

// Members
Expand All @@ -51,6 +53,7 @@ protected void onActivityCreated() {
// Keep a reference of the DrawerLayout
mDrawerLayout = (DrawerLayout) findViewById(R.id.layout_main);
mWebViewContainer = (RelativeLayout) findViewById(R.id.webview_container);
mDrawerLayout.setDrawerShadow(ContextCompat.getDrawable(this, R.drawable.shadow), MENU_DRAWER_GRAVITY);

// Set the click listener interface for the buttons
setOnClickListeners();
Expand Down Expand Up @@ -162,7 +165,6 @@ private void setOnClickListeners() {
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);
}

/**
Expand Down Expand Up @@ -381,11 +383,6 @@ public void onClick(View v) {
case R.id.menu_about:
showAboutAlert();
break;
case R.id.menu_kill:
mWebViewContainer.removeView(mWebView);
destroyWebView();
finish();
break;
}
closeMenuDrawer();
}
Expand Down Expand Up @@ -413,7 +410,7 @@ public void onClick(DialogInterface dialog, int which) {
* {@inheritDoc}
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) {
switch(keyCode){
case KeyEvent.KEYCODE_MENU:
toggleMenuDrawer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,7 @@ protected void destroyWebView() {
private boolean checkNetworkConnection() {
try {
NetworkInfo networkInfo = mConnectivityManager.getActiveNetworkInfo();
if (networkInfo != null) {
return networkInfo.isConnected();
}
return false;
return networkInfo != null && networkInfo.isConnected();
} catch (SecurityException e) {
// Catch the Security Exception in case the user revokes the ACCESS_NETWORK_STATE permission
e.printStackTrace();
Expand Down Expand Up @@ -643,7 +640,7 @@ public void openExternalSite(String url) {
* {@inheritDoc}
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) {
// Override the back button
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mWebView.canGoBack()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean isOrbotInstalled() {

private boolean isAppInstalled(String uri) {
PackageManager pm = mContext.getPackageManager();
boolean installed = false;
boolean installed;
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
installed = true;
Expand Down
191 changes: 123 additions & 68 deletions app/src/main/res/layout/drawer_menu.xml

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Daniel Velazco

Italian Translation (C) 2014 <angeloruocco90@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>

<!-- App name -->
<string name="app_name">Tinfoil for Facebook</string>
<string name="app_name_short">Tinfoil</string>

<!-- Labels -->
<string name="lbl_dialog_alert">Alert</string>
<string name="lbl_dialog_close">Chiudi</string>
<string name="lbl_dialog_ok">OK</string>
<string name="loading_video">Caricamento video&#8230;</string>
<string name="upload_file_choose">Scegli file</string>
<string name="lbl_yes">Si</string>
<string name="lbl_no">No</string>
<string name="lbl_save_image">Salva immagine</string>

<!-- Sharing -->
<string name="share_action">Condividi pagina corrente</string>
<string name="share_action_subject">Pagina Facebook</string>

<!-- Context menu items -->
<string name="menu_desktop">Desktop</string>
<string name="menu_mobile">Mobile</string>
<string name="menu_jump_top">Torna in cima</string>
<string name="menu_news_feed">Novità</string>
<string name="menu_share">Condividi</string>
<string name="menu_copy_url">Copia URL</string>
<string name="menu_refresh">Aggiorna</string>
<string name="menu_notifications">Notifiche</string>
<string name="menu_messages">Messaggi</string>
<string name="menu_preferences">Preferenze</string>
<string name="menu_about">Aiuto</string>
<string name="menu_exit">Esci</string>

<!-- Preferences -->
<string name="pref_cat_access">Accesso Facebook</string>
<string name="pref_cat_general">Generali</string>
<string name="pref_cat_proxy">Proxy</string>
<string name="prefs_allow_checkins">Permetti localizzazione</string>
<string name="prefs_allow_checkins_sry">Permetti all\'app di usare la localizzazione per taggare i luoghi</string>
<string name="prefs_open_links_inside">Apri link dentro l\'app</string>
<string name="prefs_open_links_inside_sry">Qualsiasi link aperto dall\'app verrà aperto nell\'app stessa inveche che nel browser</string>
<string name="prefs_block_images">Blocca immagini</string>
<string name="prefs_block_images_sry">Risparmia tempo e connessione impedendo all\'app di caricare le immagini</string>
<string name="pref_hide_ab">Nascondi la ActionBar</string>
<string name="pref_hide_ab_sry">Nascondi automaticamente la ActionBar quando si scorre verso il basso. Scorri verso l\'alto per farla apparire di nuovo</string>
<string name="prefs_mobile_site">Sito Mobile/Desktop</string>
<string name="prefs_mobile_site_sry">Forza l\'uso del sito in modalità desktop o mobile</string>
<string name="prefs_enable_proxy">Abilita proxy</string>
<string name="prefs_enable_proxy_sry">Configura il proxy</string>
<string name="prefs_proxy_host">Proxy host</string>
<string name="prefs_proxy_port">Proxy port</string>

<array name="prefs_mobile_site_list">
<item>Auto</item>
<item>Forza sito mobile</item>
<item>Forza sito desktop</item>
<item>Forza sito di base</item>
<item>Facebook Zero</item>
<item>Facebook.onion (richiede Orbot)</item>
</array>
<array name="prefs_mobile_site_list_values">
<item>auto</item>
<item>mobile</item>
<item>desktop</item>
<item>base</item>
<item>zero</item>
<item>onion</item>
</array>

<string name="pref_about">Aiuto</string>
<string name="pref_about_sry">Sviluppato da Daniel Velazco. Clicca qui per maggiori informazioni.</string>
<!-- End preferences -->

<string name="txt_save_image_success">Immagine scaricata e salvata nella cartella download</string>
<string name="txt_save_image_failed">Impossibile salvare immagine</string>

<!-- Orbot related strings -->
<string name="market_orbot">market://search?q=pname:org.torproject.android</string>
<string name="start_orbot_">Avviare Orbot?</string>
<string name="orbot_not_running_start_it_question">Orbot non è in esecuzione. Vuoi avviarlo e connetterti a Tor?</string>

<!-- Text used on the "about" dialog -->
<string name="txt_checkins_disables">\nFacebook sta tentando di localizzarti.\n
\nProbabilmente stai cercando di \"taggarti\" in un luogo. Nonostante Tinfoil abbia i permessi per farlo, questi sono per default disabilitati.\n
\nPuoi abilitare questa opzione andando nelle preferenze e selezionando\"Permetti localizzazione\".\n
\nTinfoil ha accesso solo alla \"Localizzazione grossolana\", e non fa uso del GPS ma solo della rete e del Wi-Fi, allo scopo di risparmiare batteria.\n
\n</string>

<!-- Text used on the "about" dialog -->
<string name="txt_about">\nSviluppato da Daniel Velazco.
\nvelazcod@gmail.com
\nhttp://www.danvelazco.com\n
\n
\nSorgente:
\nhttps://github.com/velazcod/Tinfoil-Facebook\n
\n
\nQuest\'app è per quegli utenti che hanno bisogno di un \"cappello di alluminio\" quando si connettono a Facebook. Crea un reindirizzamento al sito mobile di Facebook. Richiede i permessi INTERNET, e se sei scettico, sentiti libero di verificare il sorgente. I permessi di localizzazione grezza sono richiesti ma non utilizzati, a meno che l\'opzione \"Permetti localizzazione\" nelle preferenze non sia selezionata.\n
\n</string>
<string name="other">Altro</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<color name="light_gray_alt3">#aeaeae</color>
<color name="mild_gray">#888888</color>
<color name="dark_gray">#555555</color>
<color name="black">#DE000000</color>

<color name="blue_primary">#3B5998</color>
<color name="blue_primary_dark">#ff293c68</color>
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/values/dimensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
<dimen name="loading_video_text_size">14sp</dimen>

<!-- Drawer menu -->
<dimen name="navigation_drawer_width">240dp</dimen>
<dimen name="navigation_drawer_width">264dp</dimen>

<!-- Drawer menu items -->
<dimen name="navigation_drawer_items_height">50dp</dimen>
<dimen name="navigation_drawer_items_padding">5dp</dimen>
<dimen name="navigation_drawer_items_text_size">17sp</dimen>
<dimen name="navigation_drawer_items_icon_title_margin">5dp</dimen>
<dimen name="navigation_drawer_items_height">48dp</dimen>
<dimen name="navigation_drawer_items_padding">12dp</dimen>
<dimen name="navigation_drawer_items_padding_left">16dp</dimen>
<dimen name="navigation_drawer_items_padding_top">20dp</dimen>
<dimen name="navigation_drawer_items_icon_title_margin">32dp</dimen>
<dimen name="navigation_drawer_app_icon_size">42dp</dimen>
<dimen name="navigation_drawer_icon_size">30dp</dimen>

<dimen name="navigation_drawer_icon_size">24dp</dimen>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@
\n
\nThis app is for those users that require a Tinfoil Hat when logging in to Facebook. It creates a sandbox for facebook\'s mobile site. Requires INTERNET permissions, and if you are skeptic about it, feel free to check the source code listed above. Coarse location permissions are required but location is not used unless you turn \"Allow Check-ins\" in the preferences.\n
\n</string>

<string name="other">Other</string>
</resources>
7 changes: 0 additions & 7 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,4 @@
<style name="Widget.Tinfoil.ProgressBar" parent="android:Widget.Holo.ProgressBar.Horizontal">
</style>

<style name="MenuDrawerTextStyle" parent="@android:style/TextAppearance.Medium">
<item name="android:textSize">@dimen/navigation_drawer_items_text_size</item>
<item name="android:textColor">@color/dark_gray</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:typeface">sans</item>
</style>

</resources>