You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.2 KiB
71 lines
2.2 KiB
10 years ago
|
/*
|
||
|
* Copyright 2014 A.C.R. Development
|
||
|
*/
|
||
|
package acr.browser.lightning;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.net.Uri;
|
||
|
import android.os.Bundle;
|
||
9 years ago
|
import android.support.v7.widget.Toolbar;
|
||
10 years ago
|
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.
|
||
|
*/
|
||
9 years ago
|
public class LicenseActivity extends ThemableSettingsActivity implements View.OnClickListener {
|
||
10 years ago
|
|
||
|
@Override
|
||
|
protected void onCreate(Bundle savedInstanceState) {
|
||
|
super.onCreate(savedInstanceState);
|
||
|
setContentView(R.layout.license_activity);
|
||
9 years ago
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||
|
setSupportActionBar(toolbar);
|
||
|
|
||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||
10 years ago
|
findViewById(R.id.browserLicense).setOnClickListener(this);
|
||
|
findViewById(R.id.licenseAOSP).setOnClickListener(this);
|
||
10 years ago
|
findViewById(R.id.licenseHosts).setOnClickListener(this);
|
||
10 years ago
|
findViewById(R.id.licenseOrbot).setOnClickListener(this);
|
||
9 years ago
|
findViewById(R.id.licenseSnactory).setOnClickListener(this);
|
||
9 years ago
|
findViewById(R.id.licenseJsoup).setOnClickListener(this);
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
10 years ago
|
@Override
|
||
10 years ago
|
public void onClick(View v) {
|
||
|
switch (v.getId()) {
|
||
10 years ago
|
case R.id.browserLicense:
|
||
10 years ago
|
actionView("http://www.mozilla.org/MPL/2.0/");
|
||
|
break;
|
||
10 years ago
|
case R.id.licenseAOSP:
|
||
10 years ago
|
actionView("http://www.apache.org/licenses/LICENSE-2.0");
|
||
|
break;
|
||
|
case R.id.licenseHosts:
|
||
|
actionView("http://hosts-file.net/");
|
||
|
break;
|
||
10 years ago
|
case R.id.licenseOrbot:
|
||
|
actionView("http://www.gnu.org/licenses/lgpl.html");
|
||
|
break;
|
||
9 years ago
|
case R.id.licenseSnactory:
|
||
|
actionView("http://www.apache.org/licenses/LICENSE-2.0");
|
||
|
break;
|
||
9 years ago
|
case R.id.licenseJsoup:
|
||
|
actionView("http://jsoup.org/license");
|
||
|
break;
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|
||
10 years ago
|
private void actionView(String url) {
|
||
10 years ago
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url), this, MainActivity.class));
|
||
10 years ago
|
finish();
|
||
10 years ago
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||
|
finish();
|
||
|
return super.onOptionsItemSelected(item);
|
||
|
}
|
||
|
}
|