Android Open Source - PalmaBici Share Activity






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 2014 Sergio Garcia Villalonga (yayalose@gmail.com)
 *//from   ww  w  .ja v  a  2  s.c  o 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;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;

import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ShareActivity extends SherlockFragmentActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ActionBar actionBar;
    Button shareRealTimeButton, shareAlarmButton, shareOpenSourceButton;
    
    super.onCreate(savedInstanceState);
    setContentView(R.layout.share_layout);
    
    actionBar = getSupportActionBar();
    actionBar.setTitle(getResources().getString(R.string.sidebar_list_spread));
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    
    shareRealTimeButton = (Button) findViewById(R.id.shareRealTimeButton);
    shareRealTimeButton.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        share(v.getResources().getString(R.string.share_real_time));
      }
    });
    
    shareAlarmButton = (Button) findViewById(R.id.shareAlarmButton);
    shareAlarmButton.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        share(v.getResources().getString(R.string.share_alarm));
      }
    });
    
    shareOpenSourceButton = (Button) findViewById(R.id.shareOpenSourceButton);
    shareOpenSourceButton.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        share(v.getResources().getString(R.string.share_open_source));
      }
    });
  }
  
  private void share(String text) {
    Intent issueIntent = new Intent(Intent.ACTION_SEND);
        issueIntent.setType("text/plain");
        issueIntent.putExtra(Intent.EXTRA_TEXT, text + " " + getResources().getString(R.string.share_get_it));
        startActivity(issueIntent);
        finish();
  }
}




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