Commit 557ede64960848365d8ea201e7becf8f472339b8

Authored by Imanol-Mikel Barba Sabariego
1 parent c385a99a

--no commit message

res/layout/main_activity.xml
... ... @@ -46,4 +46,27 @@
46 46 android:layout_marginTop="21dp"
47 47 android:textAppearance="?android:attr/textAppearanceSmall" />
48 48  
  49 + <TextView
  50 + android:id="@+id/textViewAlerta"
  51 + android:layout_width="wrap_content"
  52 + android:layout_height="wrap_content"
  53 + android:layout_alignBottom="@+id/imageViewAlerta"
  54 + android:layout_alignTop="@+id/imageViewAlerta"
  55 + android:layout_toRightOf="@+id/imageViewAlerta"
  56 + android:text="@string/alertVitamioNotInstalled"
  57 + android:textColor="@color/Orange"
  58 + android:visibility="invisible" />
  59 +
  60 + <ImageView
  61 + android:id="@+id/imageViewAlerta"
  62 + android:layout_width="wrap_content"
  63 + android:layout_height="wrap_content"
  64 + android:layout_above="@+id/button"
  65 + android:layout_alignLeft="@+id/button"
  66 + android:layout_marginBottom="28dp"
  67 + android:layout_marginLeft="17dp"
  68 + android:contentDescription="@string/alertLogoDescription"
  69 + android:src="@android:drawable/ic_dialog_alert"
  70 + android:visibility="invisible" />
  71 +
49 72 </RelativeLayout>
50 73 \ No newline at end of file
... ...
res/values/strings.xml
... ... @@ -39,5 +39,7 @@
39 39 <item >2</item>
40 40 </string-array>
41 41 <string name="defaultQuality">0</string>
  42 + <string name="alertVitamioNotInstalled">Alerta! Llibreries de Vitamio no instalades!</string>
  43 + <string name="alertLogoDescription">Alerta!</string>
42 44  
43 45 </resources>
44 46 \ No newline at end of file
... ...
src/com/upc/pbe/upcnews/MainActivity.java
... ... @@ -13,6 +13,7 @@ import android.view.MenuItem;
13 13 import android.view.View;
14 14 import android.view.View.OnClickListener;
15 15 import android.widget.ImageButton;
  16 +import android.widget.ImageView;
16 17 import android.widget.TextView;
17 18 import android.widget.Toast;
18 19  
... ... @@ -21,8 +22,9 @@ public class MainActivity extends Activity implements OnClickListener {
21 22  
22 23 private final static String TAG = "Main";
23 24 private static String html;
  25 + private ImageView alerta;
24 26 private ImageButton buttonDescarrega;
25   - private TextView URLText;
  27 + private TextView URLText, alertaText;
26 28  
27 29 @Override
28 30 public void onCreate(Bundle savedInstanceState){
... ... @@ -40,6 +42,13 @@ public class MainActivity extends Activity implements OnClickListener {
40 42 buttonDescarrega = (ImageButton) findViewById(R.id.button);
41 43 buttonDescarrega.setOnClickListener(this);
42 44 updateURL();
  45 + //Mostrem el missatge d'alerta si Vitamio no esta instalat
  46 + if(!io.vov.vitamio.LibsChecker.checkVitamioLibs(this)){
  47 + alerta = (ImageView) findViewById(R.id.imageViewAlerta);
  48 + alerta.setVisibility(View.VISIBLE);
  49 + alertaText = (TextView) findViewById(R.id.textViewAlerta);
  50 + alertaText.setVisibility(View.VISIBLE);
  51 + }
43 52 }
44 53  
45 54 public void onClick(View v) {
... ...