Skip to content

Commit

Permalink
Extended IRC URI support and added Yaaic IRC link to about.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rey Rey authored and pocmo committed Jul 2, 2011
1 parent bce2523 commit 750df0d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
16 changes: 13 additions & 3 deletions application/res/layout/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,23 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
android:layout_height="wrap_content"
android:text="@string/app_homepage"
android:linksClickable="false"
android:autoLink="web"
android:autoLink="none"
android:textSize="16sp"
android:textColorLink="#FF6CB600"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/about_irclink"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/app_irc"
android:linksClickable="false"
android:autoLink="none"
android:textSize="16sp"
android:textColor="#FF6CB600"
android:clickable="true"
android:gravity="center_horizontal" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/licence_info"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
1 change: 1 addition & 0 deletions application/res/values/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<string name="app_full_name">Yet Another Android IRC Client</string>
<string name="app_version">0.8</string>
<string name="app_homepage">http://www.yaaic.org</string>
<string name="app_irc">irc://irc.epd-me.net/yaaic</string>
<string name="app_copyright">(C) 2009-2011 Sebastian Kaspari</string>

<string name="licence_info">
Expand Down
18 changes: 18 additions & 0 deletions application/src/org/yaaic/activity/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
import org.yaaic.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

/**
* About activity
Expand All @@ -33,6 +37,7 @@
*/
public class AboutActivity extends Activity
{
private TextView mIRCLink;
/**
* On create
*/
Expand All @@ -44,5 +49,18 @@ public void onCreate(Bundle savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.about);

mIRCLink = (TextView) findViewById(R.id.about_irclink);
mIRCLink.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent i = new Intent(getBaseContext(), org.yaaic.activity.AddServerActivity.class);
i.setData(Uri.parse(getString(R.string.app_irc)));
startActivity(i);
}
});

}



}
6 changes: 6 additions & 0 deletions application/src/org/yaaic/activity/AddServerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public void onCreate(Bundle savedInstanceState)
if (uri.getPort() != -1) {
((EditText) findViewById(R.id.port)).setText(String.valueOf(uri.getPort()));
}
if (uri.getPath() != null) {
channels.add(uri.getPath().replace('/', '#'));
}
if (uri.getQuery() != null) {
((EditText) findViewById(R.id.password)).setText(String.valueOf(uri.getQuery()));
}
}
}

Expand Down

0 comments on commit 750df0d

Please sign in to comment.