2014-04-28 15:41:40 -04:00
|
|
|
/*
|
|
|
|
* Copyright 2014 A.C.R. Development
|
|
|
|
*/
|
|
|
|
package acr.browser.lightning;
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.os.Bundle;
|
2015-01-29 13:25:19 -05:00
|
|
|
import android.support.v7.widget.Toolbar;
|
2014-04-28 15:41:40 -04:00
|
|
|
import android.view.MenuItem;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
/*
|
|
|
|
*NOTE: This activity must not be removed in order to comply with the Mozilla Public License v. 2.0
|
|
|
|
*under which this code is licensed. Unless you plan on providing other attribution in the app to
|
|
|
|
*the original source in another visible way, it is advised against the removal of this Activity.
|
|
|
|
*/
|
2015-04-01 22:13:46 +02:00
|
|
|
public class LicenseActivity extends ThemableSettingsActivity implements View.OnClickListener {
|
2014-04-28 15:41:40 -04:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.license_activity);
|
2015-01-29 13:25:19 -05:00
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
|
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
2014-09-01 21:26:54 -04:00
|
|
|
findViewById(R.id.browserLicense).setOnClickListener(this);
|
|
|
|
findViewById(R.id.licenseAOSP).setOnClickListener(this);
|
2014-06-08 16:44:02 +03:00
|
|
|
findViewById(R.id.licenseHosts).setOnClickListener(this);
|
2014-08-26 17:07:35 -04:00
|
|
|
findViewById(R.id.licenseOrbot).setOnClickListener(this);
|
2015-02-05 15:33:23 -05:00
|
|
|
findViewById(R.id.licenseSnactory).setOnClickListener(this);
|
2015-02-09 15:30:50 -05:00
|
|
|
findViewById(R.id.licenseJsoup).setOnClickListener(this);
|
2014-06-08 16:44:02 +03:00
|
|
|
}
|
2014-07-18 19:43:42 -04:00
|
|
|
|
2014-06-08 16:44:02 +03:00
|
|
|
@Override
|
2014-07-18 19:43:42 -04:00
|
|
|
public void onClick(View v) {
|
|
|
|
switch (v.getId()) {
|
2014-09-01 21:26:54 -04:00
|
|
|
case R.id.browserLicense:
|
2014-07-19 16:49:33 +02:00
|
|
|
actionView("http://www.mozilla.org/MPL/2.0/");
|
|
|
|
break;
|
2014-09-01 21:26:54 -04:00
|
|
|
case R.id.licenseAOSP:
|
2014-07-19 16:49:33 +02:00
|
|
|
actionView("http://www.apache.org/licenses/LICENSE-2.0");
|
|
|
|
break;
|
|
|
|
case R.id.licenseHosts:
|
|
|
|
actionView("http://hosts-file.net/");
|
|
|
|
break;
|
2014-08-26 17:07:35 -04:00
|
|
|
case R.id.licenseOrbot:
|
|
|
|
actionView("http://www.gnu.org/licenses/lgpl.html");
|
|
|
|
break;
|
2015-02-05 15:33:23 -05:00
|
|
|
case R.id.licenseSnactory:
|
|
|
|
actionView("http://www.apache.org/licenses/LICENSE-2.0");
|
|
|
|
break;
|
2015-02-09 15:30:50 -05:00
|
|
|
case R.id.licenseJsoup:
|
|
|
|
actionView("http://jsoup.org/license");
|
|
|
|
break;
|
2014-07-18 19:43:42 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-08 16:44:02 +03:00
|
|
|
private void actionView(String url) {
|
2014-07-28 17:09:03 -04:00
|
|
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url), this, MainActivity.class));
|
2014-07-18 19:43:42 -04:00
|
|
|
finish();
|
2014-04-28 15:41:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
finish();
|
|
|
|
return super.onOptionsItemSelected(item);
|
|
|
|
}
|
|
|
|
}
|