Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/ActivityAbout.java
Show All 11 Lines | BusTO - Arrival times for Turin public transports. | ||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
GNU General Public License for more details. | GNU General Public License for more details. | ||||
You should have received a copy of the GNU General Public License | You should have received a copy of the GNU General Public License | ||||
along with this program. If not, see <http://www.gnu.org/licenses/>. | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
package it.reyboz.bustorino; | package it.reyboz.bustorino; | ||||
import android.util.Log; | |||||
import androidx.appcompat.widget.Toolbar; | import androidx.appcompat.widget.Toolbar; | ||||
import androidx.core.app.NavUtils; | |||||
import androidx.appcompat.app.ActionBar; | |||||
import androidx.appcompat.app.AppCompatActivity; | import androidx.appcompat.app.AppCompatActivity; | ||||
import android.text.Html; | import android.text.Html; | ||||
import android.text.Spanned; | import android.text.Spanned; | ||||
import android.text.method.LinkMovementMethod; | import android.text.method.LinkMovementMethod; | ||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import android.view.MenuItem; | import android.view.MenuItem; | ||||
import android.widget.TextView; | import android.widget.TextView; | ||||
Show All 9 Lines | protected void onCreate(Bundle savedInstanceState) { | ||||
assert aboutTextView != null; | assert aboutTextView != null; | ||||
aboutTextView.setText(htmlText); | aboutTextView.setText(htmlText); | ||||
aboutTextView.setMovementMethod(LinkMovementMethod.getInstance()); | aboutTextView.setMovementMethod(LinkMovementMethod.getInstance()); | ||||
Toolbar mToolbar = findViewById(R.id.default_toolbar); | Toolbar mToolbar = findViewById(R.id.default_toolbar); | ||||
setSupportActionBar(mToolbar); | setSupportActionBar(mToolbar); | ||||
if (getSupportActionBar()!=null) | if (getSupportActionBar()!=null) | ||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||||
TextView versionText = findViewById(R.id.versionTextView); | |||||
Log.d("BusTO About", "The version text view is: "+versionText); | |||||
versionText.setText(getResources().getText(R.string.app_version)+": "+BuildConfig.VERSION_NAME); | |||||
} | } | ||||
@Override | @Override | ||||
public boolean onOptionsItemSelected(MenuItem item) { | public boolean onOptionsItemSelected(MenuItem item) { | ||||
// Respond to the action bar's Up/Home button | // Respond to the action bar's Up/Home button | ||||
if (item.getItemId() == android.R.id.home) {//NavUtils.navigateUpFromSameTask(this); | if (item.getItemId() == android.R.id.home) {//NavUtils.navigateUpFromSameTask(this); | ||||
onBackPressed(); | onBackPressed(); | ||||
return true; | return true; | ||||
} | } | ||||
return super.onOptionsItemSelected(item); | return super.onOptionsItemSelected(item); | ||||
} | } | ||||
} | } |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register