Android Open Source - ildn-hub Mandriva Italia






From Project

Back to project page ildn-hub.

License

The source code is released under:

GNU General Public License

If you think the Android project ildn-hub listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.ildn.mandrivaitalia;
//from   w  w w . j a  v a 2 s  . co m
import net.ildn.Authentication;
import net.ildn.OtherActivity;
import net.ildn.fedorait.R;
import android.app.TabActivity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.widget.LinearLayout;
import android.widget.TabHost;
import android.widget.TextView;

public class MandrivaItalia extends TabActivity {

  private static final String LOG_ID = "mandrivaitalia.org - mandrivaActivity";
  private int statusAuth = Authentication.NOT_ACCESS;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Log.i(LOG_ID, "Richiamato onCreate()");
    setContentView(R.layout.main);
    Resources res = getResources();
    
    TextView tv = new TextView(this);
    tv = (TextView)findViewById(R.id.testatina);
    
    /*
     * Login code
     */
    SharedPreferences settings = getSharedPreferences(getString(R.string.ildnPreference), MODE_PRIVATE);
    String portalelogin = settings.getString("portalelogin", "nessuno");
    Authentication auth = new Authentication(this);    
    if (portalelogin.equalsIgnoreCase(getString(R.string.intestazionemandriva))) {
      statusAuth = auth.login();
      Log.i(LOG_ID,"return auth status: "+ statusAuth);      
    }
    tv = (TextView)findViewById(R.id.testatina);
    if (statusAuth == Authentication.ACCESS) {
      tv.setText(auth.getUsername()+ "@" + getResources().getString(R.string.intestazionemandriva));
    }
    else 
      tv.setText(getResources().getString(R.string.intestazionemandriva));
    tv.setBackgroundResource(R.color.mandriva);    
    
    LinearLayout l = new LinearLayout(this);
    l = (LinearLayout)findViewById(R.id.sfondo);
    l.setBackgroundResource(R.color.mandriva);
    
    TabHost tabHost = getTabHost(); // The activity TabHost
    TabHost.TabSpec spec; // Reusable TabSpec for each tab
    Intent intent; // Reusable Intent for each tab

    // Create an Intent to launch an Activity for the tab (to be reused)
    intent = new Intent().setClass(this, MandrivaNewsActivity.class);

    // Initialize a TabSpec for each tab and add it to the TabHost
    spec = tabHost.newTabSpec("news")
        .setIndicator("News", res.getDrawable(R.drawable.ic_tab_news))
        .setContent(intent);
    tabHost.addTab(spec);

    // Do the same for the other tabs
    intent = new Intent().setClass(this, MandrivaForumActivity.class);
    spec = tabHost
        .newTabSpec("forum")
        .setIndicator("Forum", res.getDrawable(R.drawable.ic_tab_forum))
        .setContent(intent);
    tabHost.addTab(spec);

    intent = new Intent().setClass(this, MandrivaBlogActivity.class);
    spec = tabHost.newTabSpec("blog")
        .setIndicator("Blog", res.getDrawable(R.drawable.ic_tab_blog))
        .setContent(intent);
    tabHost.addTab(spec);

    intent = new Intent().setClass(this, MandrivaGuideActivity.class);
    spec = tabHost
        .newTabSpec("guide")
        .setIndicator("Guide", res.getDrawable(R.drawable.ic_tab_guide))
        .setContent(intent);
    tabHost.addTab(spec);

    intent = new Intent().setClass(this, OtherActivity.class);
    intent.putExtra("fonte", this.getString(R.string.intestazionemandriva));
    spec = tabHost.newTabSpec("other")
        .setIndicator("ILDN", res.getDrawable(R.drawable.ic_tab_other))
        .setContent(intent);
    tabHost.addTab(spec);

    tabHost.setCurrentTab(0);
  }

}




Java Source Code List

net.ildn.Authentication.java
net.ildn.CoverFlow.java
net.ildn.DataRetriever.java
net.ildn.GlobalMenu.java
net.ildn.ImageAdapter.java
net.ildn.ListaPortali.java
net.ildn.NewsAdapter.java
net.ildn.NewsItemRow.java
net.ildn.OtherActivity.java
net.ildn.SexySplash.java
net.ildn.SimpleCrypto.java
net.ildn.Splash.java
net.ildn.UserCredential.java
net.ildn.WebContent.java
net.ildn.debianitalia.DebianBlogActivity.java
net.ildn.debianitalia.DebianForumActivity.java
net.ildn.debianitalia.DebianGuideActivity.java
net.ildn.debianitalia.DebianItalia.java
net.ildn.debianitalia.DebianNewsActivity.java
net.ildn.fedorait.BlogActivity.java
net.ildn.fedorait.ForumActivity.java
net.ildn.fedorait.GuideActivity.java
net.ildn.fedorait.NewsActivity.java
net.ildn.fedorait.fedorait.java
net.ildn.feed.AndroidSaxFeedParser.java
net.ildn.feed.BaseFeedParser.java
net.ildn.feed.FeedParser.java
net.ildn.feed.Message.java
net.ildn.mageiaitalia.MageiaBlogActivity.java
net.ildn.mageiaitalia.MageiaForumActivity.java
net.ildn.mageiaitalia.MageiaGuideActivity.java
net.ildn.mageiaitalia.MageiaItalia.java
net.ildn.mageiaitalia.MageiaNewsActivity.java
net.ildn.mandrivaitalia.MandrivaBlogActivity.java
net.ildn.mandrivaitalia.MandrivaForumActivity.java
net.ildn.mandrivaitalia.MandrivaGuideActivity.java
net.ildn.mandrivaitalia.MandrivaItalia.java
net.ildn.mandrivaitalia.MandrivaNewsActivity.java
net.ildn.suseitalia.SuseBlogActivity.java
net.ildn.suseitalia.SuseForumActivity.java
net.ildn.suseitalia.SuseGuideActivity.java
net.ildn.suseitalia.SuseItalia.java
net.ildn.suseitalia.SuseNewsActivity.java