2012-07-24 04:43:55 +00:00
|
|
|
/**
|
2011-12-20 18:20:44 +00:00
|
|
|
* Copyright (C) 2011 Whisper Systems
|
2012-07-24 04:43:55 +00:00
|
|
|
*
|
2011-12-20 18:20:44 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2012-07-24 04:43:55 +00:00
|
|
|
*
|
2011-12-20 18:20:44 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
/**
|
2012-07-24 04:43:55 +00:00
|
|
|
* List item view for displaying user identity keys.
|
|
|
|
*
|
2011-12-20 18:20:44 +00:00
|
|
|
* @author Moxie Marlinspike
|
|
|
|
*/
|
|
|
|
public class IdentityKeyView extends RelativeLayout {
|
2012-07-24 04:43:55 +00:00
|
|
|
|
2011-12-20 18:20:44 +00:00
|
|
|
private TextView identityName;
|
2012-07-24 04:43:55 +00:00
|
|
|
private String identityKeyString;
|
|
|
|
|
2011-12-20 18:20:44 +00:00
|
|
|
public IdentityKeyView(Context context) {
|
|
|
|
super(context);
|
2012-07-24 04:43:55 +00:00
|
|
|
|
2011-12-20 18:20:44 +00:00
|
|
|
LayoutInflater li = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
|
li.inflate(R.layout.identity_key_view, this, true);
|
2012-07-24 04:43:55 +00:00
|
|
|
|
2011-12-20 18:20:44 +00:00
|
|
|
initializeResources();
|
|
|
|
}
|
2012-07-24 04:43:55 +00:00
|
|
|
|
2011-12-20 18:20:44 +00:00
|
|
|
public IdentityKeyView(Context context, AttributeSet attributeSet) {
|
|
|
|
super(context, attributeSet);
|
|
|
|
}
|
2012-07-24 04:43:55 +00:00
|
|
|
|
|
|
|
public void set(String name, String identityKeyString) {
|
2011-12-20 18:20:44 +00:00
|
|
|
identityName.setText(name);
|
2012-07-24 04:43:55 +00:00
|
|
|
this.identityKeyString = identityKeyString;
|
2011-12-20 18:20:44 +00:00
|
|
|
}
|
2012-07-24 04:43:55 +00:00
|
|
|
|
|
|
|
public String getIdentityKeyString() {
|
|
|
|
return this.identityKeyString;
|
|
|
|
}
|
|
|
|
|
2011-12-20 18:20:44 +00:00
|
|
|
private void initializeResources() {
|
|
|
|
this.identityName = (TextView)findViewById(R.id.identity_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|