Skip to content

Instantly share code, notes, and snippets.

@marinoluck
Created April 22, 2015 22:55
Show Gist options
  • Save marinoluck/9a77b7b09894da1820f1 to your computer and use it in GitHub Desktop.
Save marinoluck/9a77b7b09894da1820f1 to your computer and use it in GitHub Desktop.
unscrambling word target
package vc.zl.quizchat.view.component.chat;
import vc.zl.quizchat.R;
import vc.zl.quizchat.domain.User;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class UnscramblingWordTarget extends RelativeLayout {
private static final String TAG = "wrap_content";
private boolean ocupped;
private TextView text;
private User Model;
private int position;
private String seletedText;
public UnscramblingWordTarget(Context context) {
super(context);
initializeLayoutBasics(context);
}
private void initializeLayoutBasics(Context context) {
final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.unscrambling_word_target, this);
this.text = (TextView) findViewById(R.id.text_word);
}
public void setText(String text)
{
this.text.setText(text);
}
public String getSelectedText()
{
return seletedText;
}
public void onDropped(String text) {
seletedText = text;
ocupped = true;
this.text.setVisibility(View.GONE);
}
public void onUndropped() {
ocupped = false;
this.text.setVisibility(View.VISIBLE);
}
public boolean isOcupped() {
return ocupped;
}
public void setOcupped(boolean ocupped) {
this.ocupped = ocupped;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment