Android Open Source - PalmaBici Credits Dialog






From Project

Back to project page PalmaBici.

License

The source code is released under:

GNU General Public License

If you think the Android project PalmaBici 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

/*
 * Copyright 2012 Sergio Garcia Villalonga (yayalose@gmail.com)
 *//  w  w  w  .jav  a 2  s  .  co m
 * This file is part of PalmaBici.
 *
 *    PalmaBici is free software: you can redistribute it and/or modify
 *    it under the terms of the Affero GNU General Public License version 3
 *    as published by the Free Software Foundation.
 *
 *    PalmaBici is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *    Affero GNU General Public License for more details
 *    (https://www.gnu.org/licenses/agpl-3.0.html).
 *    
 */

package com.poguico.palmabici.widgets;

import com.poguico.palmabici.R;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.util.Linkify;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class CreditsDialog extends Dialog {

  Button closeButton, webButton, agplButton, codeButton;
  Context context;
  Dialog self;
  
  public CreditsDialog(Context context) {
    super(context);
    this.context = context;
    self = this;
    
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.setContentView(R.layout.credits_layout);  
    
    webButton    = (Button)findViewById(R.id.button_visit_web);
    codeButton   = (Button)findViewById(R.id.button_source_code);
    agplButton   = (Button)findViewById(R.id.button_agpl_license);
    closeButton  = (Button)findViewById(R.id.button_close);
    
    webButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            openUrl("https://github.com/SeGarVi/PalmaBici/wiki");
            self.hide();
        }
    });
    
    codeButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            openUrl("https://github.com/SeGarVi/PalmaBici");
            self.hide();
        }
    });
    
    agplButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            openUrl("https://www.gnu.org/licenses/agpl-3.0.en.html");
            self.hide();
        }
    });
    
    closeButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
          self.hide();
        }
    });
    
    Linkify.addLinks((TextView)findViewById(R.id.label_author), Linkify.EMAIL_ADDRESSES);
    Linkify.addLinks((TextView)findViewById(R.id.label_citybik), Linkify.WEB_URLS);
    Linkify.addLinks((TextView)findViewById(R.id.label_osm), Linkify.WEB_URLS);
    Linkify.addLinks((TextView)findViewById(R.id.label_osm_bonus), Linkify.WEB_URLS);
  }

  private void openUrl(String url) {
    Intent openUrlActivity = new Intent(Intent.ACTION_VIEW);
    openUrlActivity.setData(Uri.parse(url));
    context.startActivity(openUrlActivity);
  }
}




Java Source Code List

com.poguico.palmabici.DatabaseManager.java
com.poguico.palmabici.MainActivity.java
com.poguico.palmabici.PreferencesActivity.java
com.poguico.palmabici.ShareActivity.java
com.poguico.palmabici.SynchronizableElement.java
com.poguico.palmabici.WelcomeActivity.java
com.poguico.palmabici.map.OpenStreetMapConstants.java
com.poguico.palmabici.map.ResourceProxyImpl.java
com.poguico.palmabici.map.StationMapFragment.java
com.poguico.palmabici.network.synchronizer.NetworkStationAlarm.java
com.poguico.palmabici.network.synchronizer.NetworkSyncCallback.java
com.poguico.palmabici.network.synchronizer.NetworkSynchronizerTask.java
com.poguico.palmabici.network.synchronizer.NetworkSynchronizer.java
com.poguico.palmabici.notification.NotificationManager.java
com.poguico.palmabici.parsers.Parser.java
com.poguico.palmabici.synchronizers.LocationSynchronizer.java
com.poguico.palmabici.util.BikeLane.java
com.poguico.palmabici.util.Formatter.java
com.poguico.palmabici.util.NetworkInformation.java
com.poguico.palmabici.util.Station.java
com.poguico.palmabici.widgets.CreditsDialog.java
com.poguico.palmabici.widgets.NewFeaturesDialog.java
com.poguico.palmabici.widgets.SidebarMenu.java
com.poguico.palmabici.widgets.StationInfoWidget.java