anotherim/src/main/java/eu/siacs/conversations/ui/AboutPreference.java
2015-02-16 10:06:09 +01:00

34 lines
895 B
Java

package eu.siacs.conversations.ui;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.preference.Preference;
import android.util.AttributeSet;
import eu.siacs.conversations.utils.PhoneHelper;
public class AboutPreference extends Preference {
public AboutPreference(final Context context, final AttributeSet attrs, final int defStyle) {
super(context, attrs, defStyle);
setSummary();
}
public AboutPreference(final Context context, final AttributeSet attrs) {
super(context, attrs);
setSummary();
}
@Override
protected void onClick() {
super.onClick();
final Intent intent = new Intent(getContext(), AboutActivity.class);
getContext().startActivity(intent);
}
private void setSummary() {
setSummary("Conversations " + PhoneHelper.getVersionName(getContext()));
}
}