Conversations/src/main/java/eu/siacs/conversations/ui/AboutPreference.java

34 lines
895 B
Java
Raw Normal View History

2014-10-21 22:53:30 -04:00
package eu.siacs.conversations.ui;
import android.content.Context;
2014-11-04 12:08:30 -05:00
import android.content.Intent;
2014-10-21 22:53:30 -04:00
import android.content.pm.PackageManager;
2014-11-04 12:08:30 -05:00
import android.preference.Preference;
2014-10-21 22:53:30 -04:00
import android.util.AttributeSet;
2015-02-16 04:06:09 -05:00
import eu.siacs.conversations.utils.PhoneHelper;
2014-11-04 12:08:30 -05:00
public class AboutPreference extends Preference {
public AboutPreference(final Context context, final AttributeSet attrs, final int defStyle) {
2014-10-21 22:53:30 -04:00
super(context, attrs, defStyle);
setSummary();
}
2014-11-04 12:08:30 -05:00
public AboutPreference(final Context context, final AttributeSet attrs) {
2014-10-21 22:53:30 -04:00
super(context, attrs);
setSummary();
}
2014-11-04 12:08:30 -05:00
@Override
protected void onClick() {
super.onClick();
final Intent intent = new Intent(getContext(), AboutActivity.class);
getContext().startActivity(intent);
}
private void setSummary() {
2015-02-16 04:06:09 -05:00
setSummary("Conversations " + PhoneHelper.getVersionName(getContext()));
2014-10-21 22:53:30 -04:00
}
}