@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    CalligraphyConfig.initDefault(
        new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build());

    Initializetabs();

    viewpager = (ViewPager) findViewById(R.id.viewpager);
    viewpager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager()));

    viewpager.addOnPageChangeListener(
        new ViewPager.OnPageChangeListener() {
          @Override
          public void onPageScrolled(
              int position, float positionOffset, int positionOffsetPixels) {}

          @Override
          public void onPageSelected(int position) {

            setTabs(position);
          }

          @Override
          public void onPageScrollStateChanged(int state) {}
        });
  }
 private void initialiseFontsLibrary() {
   CalligraphyConfig.initDefault(
       new CalligraphyConfig.Builder()
           .setDefaultFontPath("fonts/Roboto-Regular.ttf")
           .setFontAttrId(R.attr.fontPath)
           .build());
 }
예제 #3
0
 private void initCalligraphy() {
   CalligraphyConfig.initDefault(
       new CalligraphyConfig.Builder()
           .setDefaultFontPath(getString(R.string.font_roboto_light))
           .setFontAttrId(R.attr.fontPath)
           .build());
 }
예제 #4
0
  private void setDefaultFont() {

    CalligraphyConfig.initDefault(
        new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/Roboto-Thin.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build());
  }
예제 #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.webviewshowlyrics);

    CalligraphyConfig.initDefault(
        new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/MAFW.TTF")
            .setFontAttrId(R.attr.fontPath)
            .build());

    Bundle extras = getIntent().getExtras();

    String infoAlongForTheRide = extras.getString("info");

    Log.d("info from mainactivity", infoAlongForTheRide);
    StringTokenizer st = new StringTokenizer(infoAlongForTheRide, "|");
    String song = st.nextToken();
    String artist = st.nextToken();
    String album = st.nextToken();
    String imageLink = st.nextToken();

    final TextView tvTrackName = (TextView) findViewById(R.id.textViewTrackName);
    tvTrackName.setText(song);
    final TextView tvArtistName = (TextView) findViewById(R.id.textViewArtistName);
    tvArtistName.setText(artist);
    final TextView tvAlbumName = (TextView) findViewById(R.id.textViewAlbumName);
    tvAlbumName.setText(album);

    ImageView imageview = (ImageView) findViewById(R.id.imageView);
    Picasso.with(ShowLyricsWebView.this).load(imageLink).fit().into(imageview);

    song.replaceAll(" ", "_");
    artist.replaceAll(" ", "_");
    Log.d("song", song);
    Log.d("artist", artist);

    //        getSupportActionBar().setDisplayShowHomeEnabled(true);
    //        getSupportActionBar().setIcon(R.drawable.ic_launcher);

    WebView webView = (WebView) findViewById(R.id.webview1);
    webView.setWebViewClient(new MyWebViewClient());

    String url =
        "http://lyrics.wikia.com/api.php?func=getSong&artist="
            + artist
            + "&song="
            + song
            + "&fmt=text";
    url = url.replaceAll("\\s", "_");

    Log.d("url is ", url);

    new RequestTask().execute(url);

    webView.getSettings().setJavaScriptEnabled(true);
    webView.loadUrl(url);
  }
예제 #6
0
 private void initParse() {
   Parse.initialize(this, getString(R.string.parseAppId), getString(R.string.parseAppKey));
   ParseObject.registerSubclass(Tour.class);
   ParseObject.registerSubclass(Node.class);
   CalligraphyConfig.initDefault(
       new CalligraphyConfig.Builder()
           .setDefaultFontPath("fonts/Roboto-Light.ttf")
           .setFontAttrId(R.attr.fontPath)
           .build());
 }
예제 #7
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_capture);

    CalligraphyConfig.initDefault(
        new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build());

    ButterKnife.bind(this);

    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    toolbar.setNavigationIcon(R.drawable.icn_back);
    title.setText("COLLECTIONS");

    FacebookSdk.sdkInitialize(this);
    callbackManager = CallbackManager.Factory.create();
    shareDialog = new ShareDialog(this);
    // this part is optional
    shareDialog.registerCallback(
        callbackManager,
        new FacebookCallback<Sharer.Result>() {
          @Override
          public void onSuccess(Sharer.Result result) {
            if (result.getPostId() != null) {
              Toast.makeText(getBaseContext(), "Success", Toast.LENGTH_SHORT).show();
            } else {
              Toast.makeText(getBaseContext(), "Problem posting story", Toast.LENGTH_SHORT).show();
            }
          }

          @Override
          public void onCancel() {
            Toast.makeText(getBaseContext(), "Cancelled", Toast.LENGTH_SHORT).show();
          }

          @Override
          public void onError(FacebookException e) {
            Toast.makeText(getBaseContext(), "Error sharing", Toast.LENGTH_SHORT).show();
          }
        });

    song_name.setText(getIntent().getStringExtra("title").toUpperCase());
    Picasso.with(getBaseContext())
        .load(getIntent().getStringExtra("image_link"))
        .placeholder(R.drawable.speaker_icn1)
        .into(album_art);
    note.setText(getIntent().getStringExtra("note"));

    playlist.setText(Html.fromHtml("or <u>Add to Playlist</u>"));
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CalligraphyConfig.initDefault(
        new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/mapolice.otf")
            .setFontAttrId(R.attr.fontPath)
            .build());
    setContentView(R.layout.register_layout);

    b = (Button) findViewById(R.id.btnAppli);
    // b2 = (Button) findViewById(R.id.Button02);
    usr = (EditText) findViewById(R.id.username);
    email = (EditText) findViewById(R.id.email);
    pass = (EditText) findViewById(R.id.password);
    confPass = (EditText) findViewById(R.id.confPass);

    // Session manager
    session = new SessionManager(getApplicationContext());

    // menu
    mDrawerList = (ListView) findViewById(R.id.amisList);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mActivityTitle = getTitle().toString();

    addDrawerItems();
    setupDrawer();

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);

    tv = (TextView) findViewById(R.id.tv);

    if (session.isLoggedIn()) {
      // Users is already logged in. Take him to main activity
      Intent intent = new Intent(Register.this, ChoixCategorie.class);
      startActivity(intent);
      finish();
    }

    b.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            dialog = ProgressDialog.show(Register.this, "", "Validation de l'inscription...", true);
            /*new Thread(new Runnable() {
            public void run() {*/
            register();
            /*}
                 }).start();
            } */ }
        });
  }
  @Override
  protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);

    CalligraphyConfig.initDefault(
        new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/RobotoCondensed-Regular.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build());

    MultiDex.install(this);
  }
예제 #10
0
  @Override
  public void onCreate() {
    super.onCreate();

    try {
      fInstance = this;
      CalligraphyConfig.initDefault(
          new CalligraphyConfig.Builder()
              .setDefaultFontPath("fonts/Nexa-Light.ttf")
              .setFontAttrId(R.attr.fontPath)
              .build());
      ACRA.init(this);
    } catch (Exception anEx) {
      Log.d("AppController" + "onCreate", anEx.toString());
    }
  }
 @Override
 public void onCreate() {
   super.onCreate();
   CalligraphyConfig.initDefault(
       new CalligraphyConfig.Builder().setFontAttrId(R.attr.fontPath).build());
 }